grhosso
(Juan)
April 3, 2018, 9:05am
1
Hi there,
Is there any rule to detect OFF status or the current status of the relay?
Everytime I open Openhab on the phone or in the laptop, I can not see the status OFF of the switches:
Actually, they are all OFF, but there is no feedback every time I open the page. I have to click on OFF to highlight them.
vzorglub
(Vincent Regaud)
April 3, 2018, 9:11am
2
Could you post your sitemap code, please?
grhosso
(Juan)
April 3, 2018, 9:14am
3
Like this:
Switch item=sonoff01 mappings=[ON="ON",OFF="OFF"]
Switch item=sonoff02 mappings=[ON="ON",OFF="OFF"]
Switch item=sonoff03 mappings=[ON="ON",OFF="OFF"]
Switch item=sonoff04 mappings=[ON="ON",OFF="OFF"]
Switch item=sonoff06 mappings=[ON="ON",OFF="OFF"]
I think I am missing something, to detect the current state.
Thanks.
vzorglub
(Vincent Regaud)
April 3, 2018, 9:15am
4
Try removing the mappings
grhosso
(Juan)
April 3, 2018, 9:31am
5
It does not work.
If I switch on from the device or from MQTTfx for example, the page does refresh , does not pick up the status
My items delacartions:
Switch sonoff01 “LEDS”
{
mqtt="
[mosquitto:cmnd/sonoff01/POWER:command:ON:1],
[mosquitto:cmnd/sonoff01/POWER:command:OFF:0],
<[mosquitto:stat/sonoff01/POWER:state:ON:1],
<[mosquitto:stat/sonoff01/POWER:state:OFF:0]
"
}
vzorglub
(Vincent Regaud)
April 3, 2018, 2:44pm
7
You need to add autoupdate=“false” in the binding {}
grhosso
(Juan)
April 3, 2018, 9:25pm
8
Hi there,
According to the documentation, this is not working for me:
>[mosquitto:sonoff01/command:command:ON:1],
>[mosquitto:sonoff01/command:command:OFF:0],
I need to out the sentece like the doc here: https://github.com/arendst/Sonoff-Tasmota/wiki/MQTT-Overview#configure-mqtt-settings
>[mosquitto:cmnd/sonoff01/POWER:command:ON:1],
>[mosquitto:cmnd/sonoff01/POWER:command:OFF:0],
Then I am using the MAP(onoff.map), it does not work. I mean, after sending a command from MQTTfx on or off, the status is not updated in the openhab BASIC/CLASIC. Of course, if I command from the BASIC page, it works, but if someone turn on the switch from the device or from other device, it is not refresh. Something I am missing…
Switch sonoff01 "LEDS" <light>
{
mqtt="
>[mosquitto:cmnd/sonoff01/POWER:command:ON:1],
>[mosquitto:cmnd/sonoff01/POWER:command:OFF:0],
<[mosquitto:sonoff01/state:state:MAP(onoff.map)]", autoupdate="false"
}
vzorglub
(Vincent Regaud)
April 3, 2018, 10:14pm
9
In MQTTfx what topic is the update sent by the sonoff and what payload?
Can you post your onoff.map file, please?
grhosso
(Juan)
April 3, 2018, 10:24pm
10
In MQTTfx,
To publish: “cmnd/sonoff01/POWER” with the PAYLOAD ON or OFF and works with 1 and 0.
To suscrbie: “stat/sonoff01/POWER”
Everything works fine between broker an client, and witches works perfect.
in transform/onoff.map:
0=OFF
1=ON
vzorglub
(Vincent Regaud)
April 3, 2018, 10:26pm
11
Switch sonoff01 "LEDS" <light>
{
mqtt="
>[mosquitto:cmnd/sonoff01/POWER:command:ON:1],
>[mosquitto:cmnd/sonoff01/POWER:command:OFF:0],
<[mosquitto:stat/sonoff01/POWER:state:MAP(onoff.map)]", autoupdate="false"
}
grhosso
(Juan)
April 3, 2018, 10:32pm
12
Mmmm now, it is working fine.
What it the meaning of < and >?
Thank you very much.
grhosso
(Juan)
April 3, 2018, 10:33pm
13
OOOOOKkk the symbols < and > o_O… loooool
vzorglub
(Vincent Regaud)
April 3, 2018, 10:34pm
14
Copy and paste browser errors, I corrected it, see above
vzorglub
(Vincent Regaud)
April 3, 2018, 10:41pm
15
Good, please mark the thread as solved.