I am not sure how to overcome a challenge and would really appreciate any suggestions or comments, as I feel I may be missing fundamental info about HA.
Short Summary:
My plan is to control the projector through IR blaster (Broadlink mini rm3). This one is configured and working properly. I decided to handle the functionality in node-red, as for turning the projector off I need to send the “turn off” command twice in a row.
Challenge:
I would like now to communicate the HA with Node-red. Normally I would create an input_boolean for that. Unfortunately, since I am not able to check the real status of the projector I would like to always have the possibility to run the “turn off” and “turn on” action. (it can be useful when I am out of the home and I want to make sure the projector is turned off)
in very simple words, instead of typical UI representation (toggle button) I would prefer to have something similar to this:
I tried another approach - to create buttons that would trigger input_boolean.turn_off or input_boolean.turn_on actions. Unfortunately, if the input_boolean is already off the action turn_off will not be visible under node-red.
My ideas to overcome the challenge:
Change the way how the input_boolean is represented (from toggle button to two lightening buttons for on/off)
Use other elements instead of input_boolean - Which one?
Create buttons and attach to them some dummy services that can be always read by node-red.
I would appreciate any comments/ideas:slight_smile:
Thank you!
But the fact is that HA has no way of knowing whether your projector is on or off. The projector itself is not integrated with HA - only the Broadlink.
This is always a problem with toggle buttons, particularly if the device involved can still be operated manually. I have a couple of lights like this (like you I use input_booleans to represent them in the UI). I have hidden the remotes, but they still get out of sync occasionally.
What happens after a power cut? Does the projector resume its earlier status, or does it default to off? If the former, you could use a properly integrated smart plug to switch it on and off and use the status of the plug in your UI.
Besides using a smart plug for on/off purposes, one which returns the energy power consumption can also be used to detect whether what is attached to it is actually on or off.
thanks for the recommendation. I was not aware that a template_switch will immediately have this graphical representation I was looking for
I am a step closer to a solution, but overall it seems the approach I took was wrong - in the node-red, I can track only the “event: state” which will not change anyway, as it is already off. I could potentially track all events but I believe it wouldn’t be very efficient.
I will need to look for an option to have something like two monostatic/push-buttons in HA that could trigger a state change that I could listen for in node-red…
Is there any other way or I am overcomplicating stuff?
to be honest, it seems like you’re overcomplicating this. What is the endgoal of this automatino. ALl you stated is that you need to send 2 turn offs in a row… which you can just create a script for. What’s the actual endgoal with this node-red automation.
2 option a. Script will allow me to do basically anything including sending twice “turn off” commands with a delay in between (required by projector)
2 option b. I may create dummy scripts that only trigger a 1ms delay and in node-red I can set a listener to state_changed of this script - it feels very nasty, but this way I can draft all functionality in node-red which is my preference. If you can fink of any other approach please let me know