I think you changed something in switchmode or a other setup.
There are many options many chances todo unwanted…
Just do a fresh clean setup and connect on gpio14 relay2.
With the two buttons in webconsole the 2 relays are switching independent
Thanks Johann,
I tested it again and its working. It may have been working the first time because the sonoff led lights up when either relay in turned on. When testing the first time there was nothing connected to either relay. I was assuming the sonoff relay was being turned on because of the led light being on. Anyway, thanks again, now I can starting looking for a good place to use my new 2 relay config:sunglasses:
My change of approach was to work with each of the three “speed” setting channels as separate openHAB Switch items. I still have the speed setting switches (used for setting via the UI). But the individual channels work best for understanding the state of each relay and setting only the required relays based on which channel (i.e., button) triggered the rule.
Nevertheless, my openHAB inter-lock rule got really complex. Accounting for all the permutations of current state to new state and considering pressing of the three buttons on the switch itself gets really ugly. OK, it’s not the complete 64 (because some current states can’t happen), but it’s more than a couple dozen. It works. There may be some finesse that could be applied if I wanted to reduce the logic in more of a boolean analysis… but I’m afraid to break it or worse, not get it completely right.
In the interim, I also decided to add a failsafe in the Sonoff switch itself. TASMOTA allows up to three rules to be coded… which turned out to be exactly the number of rules I needed - one for each speed button. I could probably simplify my openHAB rule now that I have the TASMOTA rule, but, again, if it ain’t broke, don’t fix it
If anybody is interested or has a need in the future, I’ll be happy to share my solution.
Mike
I have an ESP8266 with a ultrasonic sensor (HC-SR04). I created my own sketch and this is working perfectly with OpenHAB (MQTT).
But I wanted to test Tasmota and Easy ESP.
Easy ESP is clear for me, but I have difficulties with the MQTT part for Tasmota.
I adjusted the Telemtry period
to the minimum of 10 seconds, but my mqtt topic only reports every 10 seconds (which is normal because I’ve set this…)
But I want that I get an update everytime the sensor notices a difference (or simply every second).
Is this possible? do I need to use another topic? this is not very clear for me.
08:09:51 MQT: tele/sonoff-tst/SENSOR = {"Time":"2018-08-28T08:09:51","SR04":{"Distance":45}}
08:10:01 MQT: tele/sonoff-tst/SENSOR = {"Time":"2018-08-28T08:10:01","SR04":{"Distance":46}}
08:10:11 MQT: tele/sonoff-tst/SENSOR = {"Time":"2018-08-28T08:10:11","SR04":{"Distance":45}}
08:10:21 MQT: tele/sonoff-tst/SENSOR = {"Time":"2018-08-28T08:10:21","SR04":{"Distance":45}}
08:10:32 MQT: tele/sonoff-tst/SENSOR = {"Time":"2018-08-28T08:10:32","SR04":{"Distance":46}}
This is more of at tasmota question. Did you look in:
https://groups.google.com/forum/#!forum/sonoffusers
You can reach this via rules. See wiki
Or every second with teleperiod 1
Or ask in Discord Chat Tasmota
does anyone have the items for the Sonoff Sc to show the sensor readings, i have looked and can not find a clear answer to the tasmota firmware. thanks
Please Post the output from the webconsole you get every teleperiod time (normally 5 minutes)
With this we can define your items
21:02:21 MQT: Livingroom_Sensor/tele/INFO1 = {“Module”:“Sonoff SC”,“Version”:“6.2.1”,“FallbackTopic”:“SonoffSC”,“GroupTopic”:“sonoffs”}
21:02:21 MQT: Livingroom_Sensor/tele/INFO2 = {“WebServerMode”:“Admin”,“Hostname”:“Sonoff_Sensor”,“IPAddress”:“192.168.8.106”}
21:02:21 MQT: Livingroom_Sensor/tele/INFO3 = {“RestartReason”:“Power on”}
21:02:21 MQT: Livingroom_Sensor/tele/UPTIME = {“Time”:“2018-09-26T21:02:21”,“Uptime”:“0T00:00:17”}
21:02:29 MQT: Livingroom_Sensor/tele/STATE = {“Time”:“2018-09-26T21:02:28”,“Uptime”:“0T00:00:24”,“Vcc”:3.244,“Wifi”:{“AP”:1,“SSId”:“Boat-Network”,“RSSI”:54,“APMac”:“78:A3:51:37:4C:34”}}
21:02:29 MQT: Livingroom_Sensor/tele/SENSOR = {“Time”:“2018-09-26T21:02:29”,“SonoffSC”:{“Temperature”:20.0,“Humidity”:77.0,“Light”:10,“Noise”:50,“AirQuality”:90},“TempUnit”:“C”}
Looks like you can use an item like this for temp.
Number Livingroom_Sensor "Living Room Temp [%.1f °F]" <temperature>
{ mqtt="<[nameofyourbroker:tele/SENSOR:state:JSONPATH($.SonoffSC.Temperature)]" }
thank you for the help with a little tweaking i got it sorted.
Number Livingroom_Sensor “Living Room Temp [%.1f °C]” <temperature> (Livingroom,Sensor)
{mqtt="<[nameofyourbroker:Livingroom_Sensor/tele/SENSOR:state:JSONPATH($.SonoffSC.Temperature)]"}
will just need to implement the fixes for the temputure difference now
Hi , I am also stuck with errors on something similar for my sonoff switches. Could you post your corrected item, sitemap and rules files ?
much thanks
It seems you are trying to implement the maintenance as described in the Maintenance docs. Why don’t you follow them?
hi @opus, yes I am but it does not seem to come out right.
Can I post my files here for correction? Sorry , very new at this
thank you
home.items
Switch Switch46 “Sonoff Switch 1” {mqtt=">[broker:cmnd/sonoff-AEI/POWER:command:*:default],<[broker:stat/sonoff-AEI/POWER:state:default" }
Number Switch46_RSSI "Sonoff Switch 1: RSSI [%d %%]" (gRSSI)
{ mqtt="<[broker:tele/sonoff-AEI/STATE:state:JSONPATH($.Wifi.RSSI)]" }
String Sonoff46_Verbose "Sonoff Switch 1: MQTT return message [%s]"
{ mqtt="<[broker:tele/sonoff-AEI/INFO1:state:default],
<[broker:stat/sonoff-AEI/STATUS2:state:default],
<[broker:stat/sonoff-AEI/RESULT:state:default]" }
String Sonoff_Action "Sonoff Action" <sonoff_basic> (Sonoff_Maintenance)
String Sonoff_FW_Available "Current Release [%s]" <sonoff_basic> (Sonoff_Maintenance) { http="<[tasmotaRelease:10000:JSONPATH($[0].name)]"}
Switch Switch46_LWT "Status Sonoff Switch 1" <sonoff_basic> (Sonoff_Maintenance) { mqtt="<[ohBroker:tele/sonoff-AEI/LWT:state:MAP(reachable.map)]" }
String Switch46_FW "Firmware Sonoff Switch 1 [%s]" <sonoff_basic> (Sonoff_Maintenance) { mqtt="<[ohBroker:stat/sonoff_AEI/STATUS2:state:JSONPATH($.StatusFWR.Version)"}
home.rules
val sonoff_device_ids = newArrayList(
“Switch46”)
rule “Update Sonoff Status”
when
Time cron “0 0 0 20 * * *” // Update once a day
then
for (String device_id : sonoff_device_ids) {
logInfo(“home.rules”, "Updating FW Item for Device: " + device_id )
publish(“mybroker”, “cmnd/” + device_id + “/STATUS”, “2”)
}
end
rule “Sonoff Maintenance”
when
Item Sonoff_Action received command
then
logInfo(“home.rules”, "Sonoff Maintenance on all devices: " + receivedCommand)
for (String device_id : sonoff_device_ids) {
switch (receivedCommand) {
case “restart” :
publish(“mybroker”, “cmnd/” + device_id + “/restart”, “1”)
case “queryFW” :
publish(“mybroker”, “cmnd/” + device_id + "/status, “2”)
case “upgrade” : {
publish(“mybroker”, “cmnd/” + device_id + “/otaurl”, “http://sonoff.maddox.co.uk/tasmota/sonoff.ino.bin”)
publish(“mybroker”, “cmnd/” + device_id + “/upgrade”, “1”)
}
}
}
Sonoff_Action.postUpdate(NULL)
end
home.sitemap
sitemap home label=“Paragon”
{
Frame label=“Sonoff Switches”
{
Switch item=Switch46
Switch item=Sonoff_Action mappings=[restart=“Restart”, queryFW=“Query FW”, upgrade=“Upgrade FW”]
Text item=Sonoff_FW_Available
Switch item=Switch46_LWT
Text item=Switch46_FW
}
}
http.cfg
tasmotaRelease.url=https://api.github.com/repos/arendst/Sonoff-Tasmota/tags
tasmotaRelease.updateInterval=43200000
What exaclty is not working? Which errors do you get?
Have to have a closer look when I’m home, in the meantime check the name of your broker, you are
using “mybroker” and “broker”.
I change the name to just “broker”.
well, this is the picture under my basic UI
clicking on the sonoff action buttons dont seem to do anything.
I cannot see the current firmware of my sonoff switch , which is 6.11 btw
And I dunno why there is a on/ooff switch next to the status of Sonoff Switch 1
In the rule you are using your OH-Item-Name for the Sonoff not the sonoff internal one (sonoff-AEI).
Use some more logInfo lines in order to see what is working and what not.
On the On/Off on the sitemap: You have configured a switch, that On/Off is the control which you can use to toggle on the sitemap.
sorry, where is the OH-Item-Name you are referring to?
Can I get the status to display…just the status instead of being a switch?
Thank you