I’m starting out with openhab with some sonoff switches. I want to monitor power and switch them remotely using the app.
I was following the instructions here (almost) literally:
https://github.com/arendst/Sonoff-Tasmota/wiki/openHAB
This is the item definition:
Switch BA_Washingmachine "Washingmachine" <washer> (BA)
{ mqtt=">[broker:cmnd/sonoff_108/POWER:command:*:default],
<[broker:stat/sonoff_108/POWER:state:default]" }
Number BA_Washingmachine_Power "Washingmachine Power [%.1f W]" (BA,gPower)
{ mqtt="<[broker:tele/sonoff_108/ENERGY:state:JSONPATH($.Power)]" }
But I get stuck when implementing that in a sitemap:
sitemap sonoff label="sonoff" {
Switch item=BA_Washingmachine
Number item=BA_Washingmachine_Power
}
The Switch works. Also, I see mqtt messages regarding power. But as soon as add the number item to the sitemap, the openhab log tells me:
2018-01-19 23:48:58.453 [WARN ] [el.core.internal.ModelRepositoryImpl] - Configuration model 'sonoff.sitemap' has errors, therefore ignoring it: [3,1]: mismatched input 'Number' expecting '}
However, when I check it against the documentation it seems valid syntax to me (also I was using the Visual Studio Openhab addon).
What am I missing?
Openhab 2.2.0-1
JSONPath Transformation version 2.2.0
MQTT Action 1.11.0
MQTT Binding 1.11.0
Ubuntu 16.04