Keeping fingers crossed, but I’m busy otherwise today!
No problem man! My day has been quite busy as well.
Don’t I need a String item to link the channel to?
Keeping fingers crossed, but I’m busy otherwise today!
No problem man! My day has been quite busy as well.
Don’t I need a String item to link the channel to?
Yes, you need a string item for that one like:
String TVLights1_Version "TVLights1 Version: [%s]" { channel="mqtt:topic:embedded-mqtt-broker:TVLights1:Version"}
Additionally you need to send a command via MQTTfx in order to get the response (have to guess again!):
Lights/TVLights1/cmnd/status
with the data 2
That is because the Status2 is only sent on request!
Additionally you need to send a command via MQTTfx in order to get the response (have to guess again!):
Lights/TVLights1/cmnd/status
with the data2
That is because the Status2 is only sent on request!
This is what I get via MQTTfx
{“StatusFWR”:{“Version”:“6.4.1.13(sonoff)”,“BuildDateTime”:“2019-02-02T22:20:11”,“Boot”:31,“Core”:“2_4_2”,“SDK”:“2.2.1(cfd48f3)”}}
I would assume your string items shows “6.4.1.13(sonoff)”.
You can check that on the control section of PpaerUI if you haven’t included the item one a sitemap
My MQTTFx output is
{"StatusFWR":{"Version":"6.3.0","BuildDateTime":"2018.10.30 17:39:28","Boot":31,"Core":"2_3_0","SDK":"1.5.3(aec24ac9)"}}
I just tried something. When I send the command
Lights/TVLights1/cmnd/STATE
via MQTTfx I get the following
PaperUI Control shows
These are the .items and .things files as they stand right now
Some questions:
Is the simple mode in PaperUI on? If yes, please switch off!
I guess you did not define the item Text Value, please check if the String channel of the Generic MQTT Thi g is linked to that item. If not delete it via PaperUI.
Check if all your MQTT things are online.
Show a screen shot of the Generic MQTT Thing with all channels visible.
Does the sonoff switch toggle when you try to switch from the control on PaperUI?
Is the simple mode in PaperUI on? If yes, please switch off!
No. I turned it back on for another process and have since turned it off.
I guess you did not define the item Text Value, please check if the String channel of the Generic MQTT Thi g is linked to that item. If not delete it via PaperUI.
I’ve deleted it.
Check if all your MQTT things are online.
Everything appears to be online - Generic MQTT Thing; MQTT Broker
Show a screen shot of the Generic MQTT Thing with all channels visible.
Does the sonoff switch toggle when you try to switch from the control on PaperUI?
Yes! We’ve gotten that far to turn the switch/lights on and off via Control on PaperUI
The transformationPatern for the Version needs to be different, it should read:
"JSONPATH:$.StatusFWR.Version"
The transformationPatern for the Version needs to be different, it should read:
"JSONPATH:$.SatusFWR.Version"
Okay…where should I put "JSONPATH:$.Power"
that was suggested earlier?
That is the stateTopic for the switch, that way the thing gets is report of the actual switch state.
And sorry for asking things twice, but I got lost on the changes. For example your last posted .things file does have one text channel, named Version, the posted screenshot of the control shows two channels ( Text Value and Version).
And the last screenshot of the item showed a single text channel named Text Value.
And sorry for asking things twice, but I got lost on the changes. For example your last posted .things file does have one text channel, named Version, the posted screenshot of the control shows two channels ( Text Value and Version).
And the last screenshot of the item showed a single text channel named Text Value.
You can ask things as many times as necessary. I’m sure I’ve asked the same thing a few times and you’re wondering how one person can be so dense.
The change was after from Text Value and Version back to Text Value was after I disabled simple mode again and deleted the necessary.
This is how my .things file is currently set:
Should be fine for the moment.
So you can switch now, the switch control on PaperUzI does show the correct state, even if you switch via the device directly or the sonocWebUI?
And when posting
Lights/TVLights1/cmnd/status
with the data 2
you get the version number?
So you can switch now, the switch control on PaperUzI does show the correct state, even if you switch via the device directly or the sonocWebUI?
No, the state does not change on PaperUI if I turn it on manually or via the Sonoff WebUI
And when posting
Lights/TVLights1/cmnd/status
with the data2
you get the version number?
Yes, on MQTTfx
So both stateTopics are wrong.
Lets start with the Version.
Is the transformation JSONPATH installed?
Do you see any errors in the log?
Did you try to refresh PaperUI control when showing the sonoff controls and the MQTTfx command was sent?
If you see no error and do not get any output on the text channel, please remove the “transformationPattern” from that channel, save the file and retry the command.
Is the transformation JSONPATH installed?
Yes, it is.
Do you see any errors in the log?
No. I don’t think so. There’s one new (showed up yesterday I think) warning though.
Here are the latest log entries that relate to MQTT after restarting the openhab service:
2019-02-06 15:42:51.678 [hingStatusInfoChangedEvent] - ‘mqtt:systemBroker:embedded-mqtt-broker’ changed from UNINITIALIZED to INITIALIZING
2019-02-06 15:42:51.703 [hingStatusInfoChangedEvent] - ‘mqtt:systemBroker:embedded-mqtt-broker’ changed from INITIALIZING to ONLINE
2019-02-06 15:42:51.744 [hingStatusInfoChangedEvent] - ‘mqtt:topic:embedded-mqtt-broker:TVLights1’ changed from UNINITIALIZED (BRIDGE_UNINITIALIZED) to INITIALIZING
==> /var/log/openhab2/openhab.log <==
2019-02-06 15:42:51.761 [WARN ] [ore.common.registry.AbstractRegistry] - Cannot add “BridgeImpl” with key “mqtt:systemBroker:embedded-mqtt-broker”. It exists already from provider “ManagedThingProvider”! Failed to add a second with the same UID from provider “GenericThingProvider”!
Did you try to refresh PaperUI control when showing the sonoff controls and the MQTTfx command was sent?
I refreshed PaperUI after toggling the switch via the Sonoff WebUI and there was no change. I also waited till MQTTfx automatically showed the updated STATE information (subscribed to
Lights/TVLights1/#
) and then checked the control at PaperUI to see if there was any change in the fields there but still nothing. I did not refresh at that point.
And a test for the switch. Remove the existing stapeTopic and transformationPattern completly and set:
stateTopic=“Lights/TVLights1/stat/POWER”
Do NOT change the commandTopic!!
and then check wether the control is reacting on the switch of the device.
If you see no error and do not get any output on the text channel, please remove the “transformationPattern” from that channel, save the file and retry the command.
Retried the command and these are the log entries:
2019-02-06 16:23:23.952 [WARN ] [moquette.spi.impl.SessionsRepository] - Session does not exist. CId=DVES_A43EBF
2019-02-06 16:23:23.969 [WARN ] [moquette.spi.impl.SessionsRepository] - Session does not exist. CId=DVES_A43EBF
2019-02-06 16:23:24.318 [WARN ] [moquette.spi.impl.SessionsRepository] - Session does not exist. CId=DVES_A44C78
2019-02-06 16:23:24.329 [WARN ] [moquette.spi.impl.SessionsRepository] - Session does not exist. CId=DVES_A44C78
2019-02-06 16:23:38.221 [WARN ] [moquette.spi.impl.SessionsRepository] - Session does not exist. CId=MQTT_FX_Client
2019-02-06 16:23:38.230 [WARN ] [moquette.spi.impl.SessionsRepository] - Session does not exist. CId=MQTT_FX_Client
==> /var/log/openhab2/events.log <==
2019-02-06 16:24:13.369 [ome.event.ItemCommandEvent] - Item ‘TVLights1’ received command ON
2019-02-06 16:24:13.403 [nt.ItemStatePredictedEvent] - TVLights1 predicted to become ON
2019-02-06 16:24:13.423 [vent.ItemStateChangedEvent] - TVLights1 changed from UNDEF to ON
If that was a try with the unchanged String channel, please make that change (removing the transformationPattern)