kewashi Posted August 23, 2020 Author Posted August 23, 2020 (edited) 9 hours ago, tmorse305 said: EDIT: disregard this whole issue, it is working correctly. Brain fade on my part, you cannot control the buttons directly, it can only be done as part of a scene, except for the A button. Guess which button is tile 74... 'A' which is why it works. Thanks, sorry for the fire drill. Glad you figured it out... I was just about to suggest the same. Also, for future reference, you can turn DEBUG9 on in the hpserver.js source code to see all the gory details for ISY calls and callback results. I used this to debug the code during initial ISY development. 9 hours ago, tmorse305 said: 'last-run', & 'last-finished' This is caused by the fact that I didn't wire up programs to work with the websocket since I forgot about these fields. I figured programs were for controlling things so a websocket update wouldn't be needed to change a field state. I see now my assumption is flawed given these two state fields. I will put this on my todo list. The original values come in during the initial load of the program action names. So bottom line - this is one of those "feature" bugs... LOL Thanks again for being such a great battle tester. EDIT - It was an easy fix, so it is now there in Version 2.318 that I just posted tonight. This also adds a new cool feature to the Rule Engine that allows a field to be checked against the value of another field. The syntax is: if field==@tilenum$field, ... The @tilenum$field value will be replaced with the value of the named field of the tilenum given. So this could be used to trigger a rule if a switch matched the state of another switch, or if time is at sunset, or whatever. Edited August 23, 2020 by kewashi added fix 1
garybixler Posted August 23, 2020 Posted August 23, 2020 @kewashi Hi, I have been trying to upgrade to V 2.318 but am having issues. I am not pi command line savvy . Basically copy and paste . I removed files hpserver.js and utils.js from the hp directory. Went to the hpserver directoy and tried using this command to coping the update files into the directory. 'git clone https://github.com/kewashi/hpserver.js' and also for utils.js but I am asked for a user id and password. Tried using the pi and its password but I don't think it is looking for that. Will be nice when HP will be available on the Polisy. Any advice appreciated. Thanks Gary
kewashi Posted August 23, 2020 Author Posted August 23, 2020 1 hour ago, garybixler said: Hi, I have been trying to upgrade to V 2.318 but am having issues. I am not pi command line savvy . Basically copy and paste . I removed files hpserver.js and utils.js from the hp directory. Went to the hpserver directoy and tried using this command to coping the update files into the directory Hi Gary -- sorry for the trouble. Yea, I hear you... I'm working on the polyglot version. By the way, you can in the meantime run this on your Polisy if you ssh into it, but the same unix command issues will apply so I wouldn't bother. Anyway, back to your issue. The command you tried won't work. Here is what you will need to copy specific files from the GitHub repo: wget https://github.com/kewashi/hpserver/blob/master/hpserver.js wget https://github.com/kewashi/hpserver/blob/master/utils.js make sure you are in the main hpserver folder when you do these commands. My recommendation for making this easier is to clone the entire GitHub repo. You do this by going up a level, rename your existing hpserver folder, then type: git clone https://github.com/kewashi/hpserver.git Then go to that folder, and run: "npm init" as you did when you first installed. Copy over all your existing config files from the renamed folder, then restart the server. Once you do all this, then you can always update in the future by just doing the following command from the hpserver folder: git pull Then restarting your server. On a raspberry PI restarting the server can be done with the script I posted previously: #!/usr/local/bin/bash echo "Restarting request..." nodepid=$(ps ax | grep hpserver | grep -v grep | cut -c1-6) if [ "$nodepid" = "" ]; then echo "HP was not running" echo "Starting hpserver.js" else echo "Stopping PID: $nodepid " kill -9 $nodepid fi cp hpserver.log hpserver_old.log echo "Restarting hpserver.js" node hpserver.js >& hpserver.log & echo "Done" If you don't want to go to all this trouble, just use the wget calls above and restart your server.
kewashi Posted August 23, 2020 Author Posted August 23, 2020 (edited) 21 hours ago, tmorse305 said: Brain fade on my part, you cannot control the buttons directly, it can only be done as part of a scene, except for the A button. Guess which button is tile 74... 'A' which is why it works. This note got me thinking about a needed tweak to HousePanel... so your brain fade was useful. As you pointed out, buttons when on the HP page do not trigger any actions back on the ISY hub. And physical presses of buttons do not trigger a websocket callback so the panel can't reflect their actions. However you can of course write an ISY program triggered off of an ISY button paired to the ISY hub. This is what I do with my buttons. But again, such actions do not show up on the panel. So I got to thinking, what good are the buttons then for showing on the panel? Until now, they were useless for ISY paired buttons. It turns out that SmartThings and Hubitat paired buttons do invoke their version of the websocket callback to HousePanel, so for those hubs you could use buttons on the panel to write rules to do useful things. No so on ISY until now. I modified HP in a minor but cool update this morning to emulate an ISY websocket if a non-responsive node is pressed on the panel. The only such nodes I know of today are ISY hub paired buttons, but others could exhibit this behavior that I don't know about. Anyway, with this update when a user taps on an ISY paired button on the HP panel, the panel will toggle the button state (ST -- which is mapped to "switch" in HP) from off to on and vice versa, and it will run any HP rule triggered by a change in the button switch state. You can also tie rules to DON for buttons but this doesn't always show up for some reason on my panel. This now makes HP buttons paired on ISY useful for HP rules. I feel compelled to add that a much better way to do automation in ISY is to write an ISY program -- although I find myself using HP simply because I don't launch my ISY java thingy often. Thanks @tmorse305 for sharing the details of your testing journey that led to this super cool update. This is posted in Version 2.319. Edited August 23, 2020 by kewashi typos and other clarifications 2
garybixler Posted August 23, 2020 Posted August 23, 2020 @kewashi Thanks so much. I ended up doing a clean install and coping over the cfg files. However that issue of the phantom icons is still popping up. I was setting up a program tile and after going back to operate the extra bulbs showed up. During setup I hid everything except run and replaced that icon with the ON icon and set it up as an inverted element. After that I shrunk the tile down to a minimum height and changed color to red. These are the sizes I used in the tile: Tile H=110 W=120, run size position=80, name size position 20. Not sure if it is a way I am trying to config the tile or not. But this time I can't seem to get rid of them even after deleting. Here is what it looks like. Again thanks for your awesome product. Gary
kewashi Posted August 23, 2020 Author Posted August 23, 2020 (edited) 1 hour ago, garybixler said: But this time I can't seem to get rid of them even after deleting. Here is what it looks like. The tile names add to the class which make the background add an icon. In the editor select “whole tile” and then pick none in the icon list in the middle column. Let me know if that fixes it. You can also use a good browser inspect tool like the ones built into Chrome and Edge to see what is going on with the tile in question. My guess it the tile name is adding a class that creates the ghost. Using the editor you can disable the icon for "whole tile" or any other subid field. Edited August 23, 2020 by kewashi typos and more info
kewashi Posted August 23, 2020 Author Posted August 23, 2020 On 8/21/2020 at 12:44 PM, garybixler said: On another note it would be nice if a curtain icon was available to show an open or closed state similar to the garage doors Open, closed, and partially_open shade icons are now included. This required a tweak to tileeditor.js to handle spaces. Here is a screen shot. This is available in 2.320 as of 4:25 PM today.
tmorse305 Posted August 23, 2020 Posted August 23, 2020 15 hours ago, kewashi said: This is caused by the fact that I didn't wire up programs to work with the websocket since I forgot about these fields. I figured programs were for controlling things so a websocket update wouldn't be needed to change a field state. I see now my assumption is flawed given these two state fields. I will put this on my todo list. The original values come in during the initial load of the program action names. So bottom line - this is one of those "feature" bugs... LOL Thanks again for being such a great battle tester. EDIT - It was an easy fix, so it is now there in Version 2.318 that I just posted tonight. This also adds a new cool feature to the Rule Engine that allows a field to be checked against the value of another field. The syntax is: HI kewashi, I just upgraded, the version now says v2.320. I confirmed the button operation you added, very cool idea! The program last-run & last-finish are updating correctly, thanks for fixing that so fast. The 'status' is now updating too but coming through as a number, 21 or 31 rather than ''true' and 'false'. 1
garybixler Posted August 23, 2020 Posted August 23, 2020 @kewashi I did the git pull for the update. Worked great. Just put the shades in an icon and they look great. Thanks so much. Gary 1
kewashi Posted August 23, 2020 Author Posted August 23, 2020 2 hours ago, tmorse305 said: The 'status' is now updating too but coming through as a number, 21 or 31 rather than ''true' and 'false'. Yea I noticed that too. This is the value that ISSy pushes via the websocket— I have no idea why or what the numbers signal. I considered converting 31 to true but resisted the urge. Maybe @Michel Kohanim can shed some light. I also noted that the date and time pushed via websocket is in a shorter format compared with the original node query. Have no idea why. 1
kewashi Posted August 23, 2020 Author Posted August 23, 2020 4 hours ago, kewashi said: My guess it the tile name is adding a class that creates the ghost. The use of the word “off” in your tile name is creating the ghost. Rename your tile replacing the word “off” with something like “~off” and the ghost will go away
tmorse305 Posted August 24, 2020 Posted August 24, 2020 Hi @kewashi, I've been trying to figure out a way to create a tile with a single light bulb that can control a 3 way light switch scene. I created a rule in tile 90 that triggers the scene in tile 270. That works great, I can control the scene from tile 90 and the single bulb turns on and off. The problem I just discovered with this method is that I can't dim the light. If I manually dim the light using the physical switch, the light will dim but as soon as I stop the bulb returns to 100%. I suspect what's happening is that when tile 90 updates with the new brightness value, it triggers the rule again which trips the scene that's programmed at 100%. Is there a way to modify tile 270 directly so that there is just 1 bulb that toggles on and off? If not do you see another way to create a single tile that has the single bulb that avoids the dimming problem? Thanks again for the app and all of the help. I am using Mobilinc which is a great app, but I think yours holds a lot of potential especially for my wife and others that might find it an easier interface to understand and use.
kewashi Posted August 24, 2020 Author Posted August 24, 2020 The simplest solution I can think of is to use a different trigger for the scene so the dimmer can be used natively. You could also add a logic test tied to level to prevent the rule from triggering unless the level is say > 90 but I like the separate trigger idea better. A virtual button from Hubitat would do nicely. 1
tmorse305 Posted August 24, 2020 Posted August 24, 2020 (edited) 14 hours ago, kewashi said: The simplest solution I can think of is to use a different trigger for the scene so the dimmer can be used natively. You could also add a logic test tied to level to prevent the rule from triggering unless the level is say > 90 but I like the separate trigger idea better. A virtual button from Hubitat would do nicely. Great idea! @markv58, here is another use for your virtual switch NS. Thanks kewashi Update: I tried it using markv58's NS on ISY/Polyglot and it works like a champ. I had to add 4 rules. 2 on the virtual switch to trigger the scene and 2 on the light tile to trigger the virtual switch, the 2nd pair of rules are required to turn the virtual switch on/off if the the light is controlled by something else, the physical switch for example. Edited August 24, 2020 by tmorse305 1
kewashi Posted August 24, 2020 Author Posted August 24, 2020 Hey @tmorse305 I love that you are finding the rule engine useful. It has become one of my favorite features of HousePanel. I know the ISY team isn’t a fan since it competes with the ISY built in program feature, but the reality is it is the only way you can introduce logic that spans across multiple hubs. Anyway, glad you got it working. Also - love your light purple color scheme!
tmorse305 Posted August 25, 2020 Posted August 25, 2020 (edited) 1 hour ago, kewashi said: Hey @tmorse305 I love that you are finding the rule engine useful. It has become one of my favorite features of HousePanel. I know the ISY team isn’t a fan since it competes with the ISY built in program feature, but the reality is it is the only way you can introduce logic that spans across multiple hubs. Anyway, glad you got it working. Also - love your light purple color scheme! My plan is to limit the rule creation to helping me create the desired functionality in HousePanel. I'll let ISY do the heavy lifting program wise. Plus it will help with my sanity to have it all in one place! HousePanel does creates some interesting possibilities for multiple hub inter communication. There is a Hubitat NS already on Polyglot but there are threads on this forum asking for a way for ISY to communicate with SmartThings. You have just created a way using rules along with virtual nodes on the ISY side. @btreinders. @asbril, @Tonyhuktake note there may be a solution here for you. PS, the color scheme was the default, I thought you picked it! Edited August 25, 2020 by tmorse305
kewashi Posted August 25, 2020 Author Posted August 25, 2020 Sounds good. The default color scheme on my computer is partially transparent blue. Weird. regarding SmartThings, the code in HP has all the hard parts done for writing a polyglot for it. This is on my todo list.
tmorse305 Posted August 25, 2020 Posted August 25, 2020 Hi @kewashi, My RPi running Polyglot, NodeLinc and HousePanel crashed sometime over night. I checked the logs and the HousePanel logs shows a repeating error. The other 2 app logs seem to be ok, no errors showing. Can you check the attached log and see what happened? Thanks, hpserver.log
kewashi Posted August 25, 2020 Author Posted August 25, 2020 (edited) 8 hours ago, tmorse305 said: Can you check the attached log and see what happened? HP is actually not crashing because this error is detected inside a try/catch block as the code is trying to read the updated status of your variables. It is looking for a precision value and isn't finding it. The error looks like a crash dump but it isn't one. I updated the code to do some additional checking for bad variables to avoid this and I changed the catch dump to a warning statement. This will be in an updated to be posted soon. In the mean time, check your variables to make sure nothing weird is stored in them. It could be I assumed they are always integers and floats, but perhaps that is a bad assumption. The updated code will fix this. But bottom line is I don't think HP is what crashed your rPI. [EDIT]Update posted as V2.231 Edited August 26, 2020 by kewashi
tmorse305 Posted August 26, 2020 Posted August 26, 2020 (edited) On 8/25/2020 at 3:34 PM, kewashi said: But bottom line is I don't think HP is what crashed your rPI. [EDIT]Update posted as V2.231 Thanks kewashi, the variables all look ok, was there a specific one that was causing the error? I upgrade to V2.321. I'll let it run over night and see what happens. Just an update, I was still having trouble with local dimming getting over ridden by the rules driving the virtual node. Then I realized a much easier fix, move the virtual node into the scene on the ISY side, and delete all the rules. Oh well, it was a good exercise in playing with the rules part of your app! Edit: Turns out you still need the rules controlling the scene from the virtual switch (or a program on the ISY side). The virtual switch cannot control the scene by itself. Edited August 27, 2020 by tmorse305 1
KMan Posted August 27, 2020 Posted August 27, 2020 Glad I found this ... pretty much just what I've been looking for. Played around with it for a little bit and am amazed at how configurable it is. Well done. 2
KMan Posted August 28, 2020 Posted August 28, 2020 Started playing around with HP. Are people having success with ISY variables, or are they still in a proof of concept phase? I tried adding the variables tile ... and then painfully deleting all of the vars I didn't want on that tile. And then I created another variables tile, and it inherited all the changes I had made to the first one. Hope I'm doing something wrong!
kewashi Posted August 29, 2020 Author Posted August 29, 2020 On 8/28/2020 at 9:19 AM, KMan said: Are people having success with ISY variables, or are they still in a proof of concept phase? Variables are implemented as only one tile containing all variables. If you want a tile with just a single variable, I suggest you add the variable tile and then add a custom or blank tile and link the variable you want into that tile using the customizer. Repeat for any variable you want on a single tile. I considered making each variable its own tile but decided against it. Programs on the other hand are in their own tile. 1
KMan Posted August 30, 2020 Posted August 30, 2020 (edited) 15 hours ago, kewashi said: If you want a tile with just a single variable, I suggest ... Thanks ... I did realize after posting that linking was probably what I needed to do. Still having some glitches, but trying to work through them. I may have corrupted something, so may try starting over from scratch. Edited August 30, 2020 by KMan
Recommended Posts