I use a switch item to send a single impulse to an air conditioner, simulating a remote control. but openhab randomly repeats the command, sometimes two times three times. How can I solve the problem?
I would use a switch and the expire-binding.
Post you code please.
How exactly is your setupt?
Switch item -> which thing? -> which hardware?
What binding do you use? I think your description has not enough information to give you a proper answer.
Sending an impulse, simulating remote, sounds for me like you use a transmitter infrared, rf etc…
Something I can say is, if you use an 433MHz transmitter with an rpi and the RPI_utils/send, then this is hardcoded. But I think it can be changed, somehow.
I interface openhab with the souliss framework. (http://souliss.net/) which can be controlled by an app on android systems. On the Souliss side everything works fine, a single pulse is sent via a nodeMCU card with an IR transmitter, while on the openhab side this command is repeated several times. this is the code for the item:
Switch condizionatore_notte_off "" <button> (gclima, TechnicView_Node1) {souliss="T14:3:0", autoupdate="true"}
String clima_notte_preset "clima notte" (gclima, TechnicView_Node1)
and this is the sitemap:
Switch item=clima_notte_preset mappings=["0"=" OFF"]
and the rule:
rule "clima giorno preset"
when
Item clima_giorno_preset received command
then
switch(receivedCommand) {
case "0": sendCommand( condizionatore_giorno_off, ON)
}
end
I’m guessing, you also have a cluma_notte_preset
rule?
- what’s in the logs, if you press the button?
- and why do you need so many blanks für the mapping in your sitemap?
on a side note:
- do you only need ON/OFF or are there other modes also?
yes, I also have a rule.
I attach the log of another item (mediacenter), which works with the same criterion. As you can see, I sent a single command and there were three status changes.
I need so many spaces for a correct impagionation on the android app. And yes, I only need to ON / OFF, indeed for the accuracy being a single impulse is enough ON only
IMHO the log doesn’t show duplicated events. It shows an event : “change from ON to OFF” followed by: " change from OFF to ONE and then back again.
Do you use the expire-binding.