-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Toggle fuction #404
Comments
(assumed) state is stored internally and is accessible through the REST API and retained MQTT messages. No need to keep track of it externally. Where I have things that toggle on/off state, I just use HomeAssistant's toggle functionality. Does this help? |
No I have a Xiaomi switch which controls the lights by converting the payload into a MQTT message, and whenever, a button in the NodeRed dashboard, the original panels or the remotes are turning lights on/off I would like to be able to change the state of a specific zone using a "button" in NodeRed, but this button does not know if the latest state is on or off. I think I will try to find a solution where a db entry will set latest state, and then the NodeRed dashboard button will read this, react by choosing the opposite state, and then save the new state to the db for the next control and send an "update" MQTT for the ESP8266_milight_hub |
There's no need to add another layer that keeps track of state. espMH already tracks state. |
Yes is keeps track but dosen't allow for "just" a state change. It is not possible to send a "toggle" command which changes the from "on to off" or "off to on". Such an option would make it compatible with external button's AND Node-Red dashboard "button". For instance the Sonoff custom firmware Tasmota, has such a function which allows for three (3) different devices to be controlled from one (1) Xiaomi wireless button (single, double and long press). This eliminating the need for a function, a db, and programming skills for the users. (Not that this is not good enough to be capable of, but not always an option) |
I think you need to raise an issue or look up details for NodeRed. |
@garmck Perfect How do you update the MQTT statement for the bulbs, in order for the "button" in NodeRed Dashboard to switch off, in case the bulb is already on, by one of your hardware remotes? Keep in mind that the "button" in NodeRed thinks that the bulb is off (as this was the last switch it made) Simplyfied: Node-red button turns on bulb (Bulb = ON - button = ON) How did you update the "button" state in Node-Red? |
I'm not using NodeRed. As stated this maybe a limitation of NodeRed NOT espMH. In espMH for MQTT settings have you configured topic, update topic and state topic ? |
Yes everything works perfectly. There are no issues with, espMH, MQTT, Node-Red, Xiaomi, Sonoff's, etc Only looking for a "toggle" function, which makes a button possible or a way to update a switch to actual state in Node-Red dashboard |
If anybody has any idea's please share. I am looking for something like this:
This command works with hardware which uses Tasmota software |
It's not an unreasonable ask, although it'd look something like
|
Added in 1.9.0-dev8. |
I have not tried this yet, but THANKS!!!!!!!!!!!!!!!! |
Is there a way to create a "simple" Node-Red toggle button?
Perhaps a MQTT function which checks current state and then sends the opposite?
The above is ABSOLUTELY now a correct code, but can anybody make one which works?
If the above is not possible could it perhaps be done by a MySQL db, where the latest state is stored in a DB which is then checked before choosing the state we wish for?
I would prefer if somebody could direct me to the DB solution, because I have hardware button which also is controlling the light, and would like to whole system to work together.
The text was updated successfully, but these errors were encountered: