There is something wrong with my configuration. Can someone help me to figure it out please?
The basic UI does not show any values
pictures:
sonoff.rules
// Work with a list of selected Sonoff modules
val sonoff_device_ids = newArrayList(
"sonoff",
//... add all your modules here!
"sonoff-B455D8"
)
// OR
// Work with the grouptopic, addressing ALL modules at once
//val sonoff_device_ids = newArrayList("sonoffs")
rule "Sonoff Maintenance"
when
Item Sonoff_Action received command
then
logInfo("sonoff.rules", "Sonoff Maintenance on all devices: " + receivedCommand)
for (String device_id : sonoff_device_ids) {
switch (receivedCommand) {
case "restart" :
publish("broker", "cmnd/" + device_id + "/restart", "1")
case "queryFW" :
publish("broker", "cmnd/" + device_id + "/status", "2")
case "upgrade" : {
publish("broker", "cmnd/" + device_id + "/otaurl", "http://sonoff.maddox.co.uk/tasmota/sonoff.ino.bin")
publish("broker", "cmnd/" + device_id + "/upgrade", "1")
}
}
}
Sonoff_Action.postUpdate(NULL)
end
sonoff.items
// compare with example message stream above!
Switch BA_Washingmachine "Washingmachine" <washer> (BA)
{ mqtt=">[broker:cmnd/sonoff/POWER:command:*:default],
<[broker:stat/sonoffPOWER:state:default]" }
Number BA_Washingmachine_Power "Washingmachine Power [%.1f W]" (BA,gPower)
{ mqtt="<[broker:tele/sonoff/ENERGY:state:JSONPATH($.Power)]" }
Switch LivingRoom_Light_Reachable "Living Room Light: reachable" (gReachable)
{ mqtt="<[broker:tele/sonoff/LWT:state:MAP(reachable.map)]" }
//Maintenance
String Sonoff_Action "Sonoff Action" <sonoff_basic>
SimonHome.sitemaps
```php
sitemap demo label="My home automation" {
Frame label="Date" {
Text item=Date
}
Frame label="Demo" {
Switch item=Sonoff_Action mappings=[restart="Restart", queryFW="Query FW", upgrade="Upgrade FW"]
Switch item=sonoff
Text item=sonoff label= "Washingmachine Power [%.1f W]"
Switch item=Lights icon="light"
Text item=LR_Temperature label="Livingroom [%.1f °C]"
Group item=Heating
Text item=LR_Multimedia_Summary label="Multimedia [%s]" icon="video" {
Selection item=LR_TV_Channel mappings=[0="off", 1="DasErste", 2="BBC One", 3="Cartoon Network"]
Slider item=LR_TV_Volume
}
}
}
**logs:**
pi@raspberrypi:/etc/openhab2/rules $ mosquitto_sub -h localhost -t "+/sonoff/#" -v
tele/sonoff/LWT Offline
tele/sonoff/LWT Online
cmnd/sonoff/POWER (null)
tele/sonoff/INFO1 {"Module":"Sonoff Pow", "Version":"5.9.1", "FallbackTopic":"sonoff", "GroupTopic":"sonoffs"}
tele/sonoff/INFO2 {"WebServerMode":"Admin", "Hostname":"sonoff-5592", "IPAddress":"192.168.0.14"}
tele/sonoff/INFO3 {"RestartReason":"Software/System restart"}
stat/sonoff/RESULT {"POWER":"ON"}
stat/sonoff/POWER ON
tele/sonoff/STATE {"Time":"2018-02-21T04:21:31", "Uptime":0, "Vcc":3.204, "POWER":"ON", "Wifi":{"AP":2, "SSId":"KabelBox-Simon", "RSSI":40, "APMac":"54:67:51:23:81:5C"}}
tele/sonoff/ENERGY {"Time":"2018-02-21T04:21:31", "Total":0.168, "Yesterday":0.000, "Today":0.168, "Period":4, "Power":955, "Factor":1.00, "Voltage":223, "Current":4.093}
tele/sonoff/STATE {"Time":"2018-02-21T04:26:45", "Uptime":0, "Vcc":3.204, "POWER":"ON", "Wifi":{"AP":2, "SSId":"KabelBox-Simon", "RSSI":56, "APMac":"54:67:51:23:81:5C"}}
tele/sonoff/ENERGY {"Time":"2018-02-21T04:26:45", "Total":0.252, "Yesterday":0.000, "Today":0.252, "Period":87, "Power":957, "Factor":1.00, "Voltage":223, "Current":4.105}
* Platform information:
* Hardware: raspberrypi
* OS: raspbian
* Java Runtime Environment: _which java platform is used and what version_
* openHAB version: 2