asbril Posted January 29, 2023 Posted January 29, 2023 How can I use a ISY Variable as a trigger in a Home Assistant automation ? 1
MrBill Posted January 29, 2023 Posted January 29, 2023 With HA it doesn't matter whether it's an integer variable or a state variable, on the HA side they can both be triggers. Here is one that I use: {{ states('sensor.saway_ha') | int == 2 }} the name of the ISY variable is $sAway.HA, the value that triggers the automation is 2 (when vacation mode is set) you can develop the string you need using 'Developer Tools' on the left menu and the Template tab. Clear out everything in the template editor window and start typing as above when you get to the end of {{ states('sensor. and start into the variable name you will start to see suggestions for variables that have entities available. one you have to complete term into the template editor you will see True of False to the right of the window. Showing how the statement is currently evaluating. now change the value of the ISY variable and watch the evaluation to the right changes. Once you have the true's and false's evaluating correction copy the term in the template editor. and go to Automations. New Automation, add trigger, type is Template. Paste the line you copied from the template editor. Then finish your automation. That nails it for a simple value... the "template" that you create could include other operators and multiple conditions. If you've got something that's more complex I can help you work it out... but need more details and might be better if we just did a remote session.
MrBill Posted January 29, 2023 Posted January 29, 2023 it just occurred to me you're running the new either alpha and/or beta channel of the ISY integration. This will likely effect your string.... On 1/8/2023 at 3:05 PM, shbatm said: Variable Sensors will be removed and Variables will be available as Number entities (both value and init) that can be directly controlled (isy994.set_variable service goes away in 2023.5.0) you'll at least need to change "sensor." to "number." and play with the result in the template editor to get the result to true or false.
asbril Posted January 29, 2023 Author Posted January 29, 2023 (edited) 18 minutes ago, MrBill said: it just occurred to me you're running the new either alpha and/or beta channel of the ISY integration. This will likely effect your string.... you'll at least need to change "sensor." to "number." and play with the result in the template editor to get the result to true or false. Thanks so much. I am not familiar with template editor and am going to read your post carefully and in detail. What I am trying to achieve is programing of my LifX bulbs. I have not succeeded in getting the LifX Node Server to work, while the HA LifX integration works. The idea is to create a Variable in eisy that will be part of a program, and then use that Variable in a HA Automation. Edited January 29, 2023 by asbril 1
MrBill Posted January 29, 2023 Posted January 29, 2023 1 minute ago, asbril said: Thanks so much. I am not familiar with template editor and am going to read your post carefully and in detail. What I am trying to achieve is programing of my LifX bulbs. I have not succeeded in getting the LifX Node Server to work, while the HA LifX integration works. The idea is to create a Variable in eisy that will be part of a program, and then use that Variable in a HA Automation. being a fairly simple usage i'd just create the variable as an integer variable on the ISY side, then reload HA, then find the entity that was created. I believe in the version you have all the variables are brought in but may not be enabled. Would the state he simple.... 0 for off and 1 for on? or is it an RGB bulb where color might need to be included?
asbril Posted January 29, 2023 Author Posted January 29, 2023 4 minutes ago, MrBill said: being a fairly simple usage i'd just create the variable as an integer variable on the ISY side, then reload HA, then find the entity that was created. I believe in the version you have all the variables are brought in but may not be enabled. Would the state simple.... 0 for off and 1 for on? or is it an RGB bulb where color might need to be included? While I have not figured out yet how to set the color in HA, the idea is for the eisy Variable to be 1=ON 0=OFF.
carealtor Posted January 29, 2023 Posted January 29, 2023 41 minutes ago, asbril said: I am not familiar with template editor From what I've encountered, it's an entire career path in itself. 2
shbatm Posted January 30, 2023 Posted January 30, 2023 You shouldn't need a template for variables now You should be able to use a Numeric Trigger from the UI 1 1
MrBill Posted January 30, 2023 Posted January 30, 2023 11 hours ago, shbatm said: You shouldn't need a template for variables now You should be able to use a Numeric Trigger from the UI it looks like there's a change coming to Numeric state trigger UI that I don't have yet, but they still only allow comparison to "above" and "below" which has always been weird to me. No Equals, no above or equal, no below or equal. For example to use the UI and you want to specify freezing or above, you need might need to use "above 31.9F" ...... or you can just use a template there too!
shbatm Posted January 30, 2023 Posted January 30, 2023 13 minutes ago, MrBill said: always been weird to me. No Equals, no above or equal, no below or equal. Agree. Its a "crossing" trigger and not an equal trigger. Alternatively if you're just using 0 and 1 then you can just use a state trigger for 'when state is 0' etc. 1
MrBill Posted January 30, 2023 Posted January 30, 2023 45 minutes ago, shbatm said: state trigger Another weird one IMO... why can't they just use comparison operators... = ≠< > <= <= etc Those two UI areas are specifically what forced me to learn templates tho...
larryllix Posted January 30, 2023 Posted January 30, 2023 Another weird one IMO... why can't they just use comparison operators... = ≠ Those two UI areas are specifically what forced me to learn templates tho... Next you'll want things like ≈Sent from my SM-G781W using Tapatalk
Recommended Posts