Would you be a bit more specific about what you want to do?
The sonoff basic is a switch that acts on commands. Do you want the relay to switch on then off again?
I open some gates by closing the Sonoff relay for 1/2 a sec using
pulsetime 5
and here is an excerpt from my yaml file -
- platform: mqtt
name: "Gate"
state_topic: "stat/sonoff-015-Gate/POWER"
command_topic: "cmnd/sonoff-015-Gate/POWER"
availability_topic: "tele/sonoff-015-Gate/LWT"
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: false # NB FALSE here - we do not want to retain the ON flag posted to open
PS Please post code corectly to make it easier for people to help you - highlight the code then hit the button which looks like </>
hello and thank you for your interest. these are the options I can manage in tasmota’s firmware. I use arduino ide to transfer the firmware to the sonoff. in the user_config section you will find these options that you can modify according to the operation you want to get from the sonoff
what do you mean when you tell me to change your image? Where is this swcondo option you? I want to get a simple impulse of the sonoff and I want the status to be updated when the lamp is on or off
Hi, your information is correct! Now the sonoff I get the impulse I wanted. The problem is that the state of the button in HA follows the hypulso … Let me explain: I want that when I press the button in HA the stao appears “On” when the lamp is on and “off” when and 'turned off even if I only give an impulse. How can I set only the status of the HA icon?
There are lots of ways of doing that. But none of them are very good, because you do not know what the state of the lamp is (for example, if HA re-starts, or if someone toggles the lamp outside of the Sonoff).
If it was me, I would set up a new dummy light in HA, then have an automation which has a trigger of the Sonoff turning ON, with an action of “toggle” on the state of the new light. Then every time you get the impulse the state of the dummy light will toggle between ON and OFF - probably the best you can do.
Um … this is not beautiful! Is it possible that there is not an option that allows me to keep feedback high (or low) until it squashes again? For the physical keys my idea is to use a double button that goes every time to excite both a traditional relay and the sonoff. In this way I can keep the sonoff and my traditional system completely isolated (and I was also thinking about updating the state in this way). This means that even if the sonoff should one day abandon me, I can always count on my civil system. But I want the correct feedback. With the automation of ha I can do nothing? It is necessary to understand which bit is related to the status of the sonoff’s specola and to intervene there.
I’m trying to understand your scenario, tell me if I’m correct.
You have a light that is controlled by a latching relay, with momentary buttons on the wall that turn on or off the light at every press. You added the Sonoff in parallel, as another momentary button that toggles the state of the light.
Now you are trying to make the status in HA follow the real status of the light.
I see two options:
you connect the pushbuttons only as an input to the Sonoff. This way you can also think of replacing the relay and let the Sonoff control directly the lights. If the Sonoff breaks, you lose control of the light
you build or find a current-sensing circuit that gets the real status of the light from the output of the relay and connect that to the input of the Sonoff