MQTT Broker for Zigbee2MQTT works / Another Device with on the same Broker fails

Tags: #<Tag:0x00007efec77f32e0>

‘’’
Version: 2.5.9 (Build)
Raspberry PI 4
‘’’

Hi Team,

i just installed zigbee2mqtt with mosquitto and everything works without problems.
Now I finished my solarcontroller that publishes all data to the same mosquitto broker.

I just see the state descriptions and the subscription:
‘’’
Adding state description for channel mqtt:topic:mosquitto:solarcontrol:temperature1
Adding state description for channel mqtt:topic:mosquitto:solarcontrol:temperature2
Adding state description for channel mqtt:topic:mosquitto:solarcontrol:temperature3
Adding state description for channel mqtt:topic:mosquitto:solarcontrol:temperature4
Adding state description for channel mqtt:topic:mosquitto:solarcontrol:temperature5
Adding state description for channel mqtt:topic:mosquitto:solarcontrol:temperature6
Adding state description for channel mqtt:topic:mosquitto:solarcontrol:temperature7
Adding state description for channel mqtt:topic:mosquitto:solarcontrol:temperature8
Adding state description for channel mqtt:topic:mosquitto:solarcontrol:temperature9
Adding state description for channel mqtt:topic:mosquitto:solarcontrol:switch1
Adding state description for channel mqtt:topic:mosquitto:solarcontrol:switch2
Adding state description for channel mqtt:topic:mosquitto:solarcontrol:switch3
Adding state description for channel mqtt:topic:mosquitto:solarcontrol:switch4
Adding state description for channel mqtt:topic:mosquitto:solarcontrol:frequency1
Adding state description for channel mqtt:topic:mosquitto:solarcontrol:frequency2
Subscribed channel mqtt:topic:mosquitto:solarcontrol:switch1 to topic: solarcontrol/rel/rel0
Subscribed channel mqtt:topic:mosquitto:solarcontrol:temperature9 to topic: solarcontrol/temp/283AA73802000045
Subscribed channel mqtt:topic:mosquitto:solarcontrol:temperature8 to topic: solarcontrol/temp/28F29438020000B1
Subscribed channel mqtt:topic:mosquitto:solarcontrol:temperature7 to topic: solarcontrol/temp/106D57290208006C
Subscribed channel mqtt:topic:mosquitto:solarcontrol:temperature6 to topic: solarcontrol/temp/RTD5
Subscribed channel mqtt:topic:mosquitto:solarcontrol:temperature5 to topic: solarcontrol/temp/RTD4
Subscribed channel mqtt:topic:mosquitto:solarcontrol:temperature4 to topic: solarcontrol/temp/RTD3
Subscribed channel mqtt:topic:mosquitto:solarcontrol:temperature3 to topic: solarcontrol/temp/RTD2
Subscribed channel mqtt:topic:mosquitto:solarcontrol:temperature1 to topic: solarcontrol/temp/RTD0
Subscribed channel mqtt:topic:mosquitto:solarcontrol:temperature2 to topic: solarcontrol/temp/RTD1
Subscribed channel mqtt:topic:mosquitto:solarcontrol:frequency1 to topic: solarcontrol/flow/flow0
Subscribed channel mqtt:topic:mosquitto:solarcontrol:frequency2 to topic: solarcontrol/flow/flow1
Subscribed channel mqtt:topic:mosquitto:solarcontrol:switch4 to topic: solarcontrol/rel/rel3
Subscribed channel mqtt:topic:mosquitto:solarcontrol:switch2 to topic: solarcontrol/rel/rel1
Subscribed channel mqtt:topic:mosquitto:solarcontrol:switch3 to topic: solarcontrol/rel/rel2
‘’’
The PaperUI shows no panel, the BasicUI shows the panel without data.

I cannot solve the problem… Any Ideas?

Example of the Payloads:
The Device has
‘’’

  • 6 RTD Ports
  • Onewire.
  • 4 Relais
  • 2 ports to messure impules from the flow sensors
    ‘’’
    Is it possible that one thing can only have one temperature port?

Thanks in advance
Jens

P.S.: Some Payloads of my device: (Homemade, RaspberryPi Zero)
‘’’
solarcontrol/flow/flow1 b’{“sensorType”: “flow”, “id”: “flow1”, “name”: “flow1”, “flow”: 0, “time”: 1602800860663720071, “valid”: true}’
solarcontrol/rel/rel2 b’{“sensorType”: “rel”, “id”: “rel2”, “name”: “rel2”, “state”: “OFF”, “time”: 1602800901711503628, “valid”: true}’
solarcontrol/temp/RTD1 b’{“sensorType”: “rtd”, “id”: 1, “name”: “RTD1”, “resistence”: 997.052001953125, “temp”: -0.7397311196726588, “time”: 1602800944170003724, “valid”: true}’
solarcontrol/temp/28F29438020000B1 b’{“sensorType”: “owtemp”, “id”: “28F29438020000B1”, “name”: “28F29438020000B1”, “temp”: 25.125, “time”: 1602800990373456593, “valid”: true}’
‘’’

Have you created a new thing for your device so openHAB know’s what it is? Can you share your thing

Of course can I share the Device:

Here the things:

‘’’
Bridge mqtt:broker:mosquitto [host=“localhost”, secure=false, clientID=“openhab2”]
{
Thing topic solarcontrol “Solarcontroller” {
Channels:
Type number : temperature1 “RTD0” [ stateTopic=“solarcontrol/temp/RTD0”, transformationPattern=“JSONPATH:$.temp”]
Type number : temperature2 “RTD1” [ stateTopic=“solarcontrol/temp/RTD1”, transformationPattern=“JSONPATH:$.temp”]
Type number : temperature3 “RTD2” [ stateTopic=“solarcontrol/temp/RTD2”, transformationPattern=“JSONPATH:$.temp”]
Type number : temperature4 “RTD3” [ stateTopic=“solarcontrol/temp/RTD3”, transformationPattern=“JSONPATH:$.temp”]
Type number : temperature5 “RTD4” [ stateTopic=“solarcontrol/temp/RTD4”, transformationPattern=“JSONPATH:$.temp”]
Type number : temperature6 “RTD5” [ stateTopic=“solarcontrol/temp/RTD5”, transformationPattern=“JSONPATH:$.temp”]
Type number : temperature7 “OW0” [ stateTopic=“solarcontrol/temp/106D57290208006C”, transformationPattern=“JSONPATH:$.temp”]
Type number : temperature8 “OW1” [ stateTopic=“solarcontrol/temp/28F29438020000B1”, transformationPattern=“JSONPATH:$.temp”]
Type number : temperature9 “OW2” [ stateTopic=“solarcontrol/temp/283AA73802000045”, transformationPattern=“JSONPATH:$.temp”]
Type switch : switch1 “REL0” [ stateTopic=“solarcontrol/rel/rel0”, transformationPattern=“JSONPATH:$.state”]
Type switch : switch2 “REL1” [ stateTopic=“solarcontrol/rel/rel1”, transformationPattern=“JSONPATH:$.state”]
Type switch : switch3 “REL2” [ stateTopic=“solarcontrol/rel/rel2”, transformationPattern=“JSONPATH:$.state”]
Type switch : switch4 “REL3” [ stateTopic=“solarcontrol/rel/rel3”, transformationPattern=“JSONPATH:$.state”]
Type number : frequency1 “FLOW0” [ stateTopic=“solarcontrol/flow/flow0”, transformationPattern=“JSONPATH:$.flow”]
Type number : frequency2 “FLOW1” [ stateTopic=“solarcontrol/flow/flow1”, transformationPattern=“JSONPATH:$.flow”]
}
‘’’

And the Items
‘’’
Number xRTD0 "Temp [ %0.2f C] " (Solarcontroller) { channel=“mqtt:broker:mosquitto:SC_RTD0:temp”}
Number xRTD1 "Temp [ %0.2f C] " (Solarcontroller) { channel=“mqtt:broker:mosquitto:SC_RTD1:temp”}
Number xRTD2 "Temp [ %0.2f C] " (Solarcontroller) { channel=“mqtt:broker:mosquitto:SC_RTD2:temp”}
Number xRTD3 "Temp [ %0.2f C] " (Solarcontroller) { channel=“mqtt:broker:mosquitto:SC_RTD3:temp”}
Number xRTD4 "Temp [ %0.2f C] " (Solarcontroller) { channel=“mqtt:broker:mosquitto:SC_RTD4:temp”}
Number xRTD5 "Temp [ %0.2f C] " (Solarcontroller) { channel=“mqtt:broker:mosquitto:SC_RTD5:temp”}
Number x106D57290208006C "Temp [ %0.2f C] " (Solarcontroller) { channel=“mqtt:broker:mosquitto:SC_OWT0:temp”}
Number x28F29438020000B1 "Temp [ %0.2f C] " (Solarcontroller) { channel=“mqtt:broker:mosquitto:SC_OWT1:temp”}
Number x283AA73802000045 "Temp [ %0.2f C] " (Solarcontroller) { channel=“mqtt:broker:mosquitto:SC_OWT2:temp”}
Switch xREL0 “Switch [ %s ]” (Solarcontroller) { channel=“mqtt:broker:mosquitto:SC_REL0:state”}
Switch xREL1 “Switch [ %s ]” (Solarcontroller) { channel=“mqtt:broker:mosquitto:SC_REL1:state”}
Switch xREL2 “Switch [ %s ]” (Solarcontroller) { channel=“mqtt:broker:mosquitto:SC_REL2:state”}
Switch xREL3 “Switch [ %s ]” (Solarcontroller) { channel=“mqtt:broker:mosquitto:SC_REL3:state”}
Number xFLOW0 “Flow [ %d ]” (Solarcontroller) { channel=“mqtt:broker:mosquitto:SC_FREQ0:flow”}
Number xFLOW1 “Flow [ %d ]” (Solarcontroller) { channel=“mqtt:broker:mosquitto:SC_FREQ1:flow”}
‘’’

I tried a lot of things to get it working, but still no success…

Thanks in advance!
Jens

Try these items

Number   SolarcontrollerTemperature2   "Rtd1"    {channel="mqtt:topic:mosquitto:solarcontrol:temperature2"}
Number   SolarcontrollerTemperature3   "Rtd2"    {channel="mqtt:topic:mosquitto:solarcontrol:temperature3"}
Number   SolarcontrollerTemperature4   "Rtd3"    {channel="mqtt:topic:mosquitto:solarcontrol:temperature4"}
Number   SolarcontrollerTemperature5   "Rtd4"    {channel="mqtt:topic:mosquitto:solarcontrol:temperature5"}
Number   SolarcontrollerTemperature6   "Rtd5"    {channel="mqtt:topic:mosquitto:solarcontrol:temperature6"}
Number   SolarcontrollerTemperature7   "Ow0"     {channel="mqtt:topic:mosquitto:solarcontrol:temperature7"}
Number   SolarcontrollerTemperature8   "Ow1"     {channel="mqtt:topic:mosquitto:solarcontrol:temperature8"}
Number   SolarcontrollerTemperature9   "Ow2"     {channel="mqtt:topic:mosquitto:solarcontrol:temperature9"}
Switch   SolarcontrollerSwitch1        "Rel0"    {channel="mqtt:topic:mosquitto:solarcontrol:switch1"}
Switch   SolarcontrollerSwitch2        "Rel1"    {channel="mqtt:topic:mosquitto:solarcontrol:switch2"}
Switch   SolarcontrollerSwitch3        "Rel2"    {channel="mqtt:topic:mosquitto:solarcontrol:switch3"}
Switch   SolarcontrollerSwitch4        "Rel3"    {channel="mqtt:topic:mosquitto:solarcontrol:switch4"}
Number   SolarcontrollerFrequency1     "Flow0"   {channel="mqtt:topic:mosquitto:solarcontrol:frequency1"}
Number   SolarcontrollerFrequency2     "Flow1"   {channel="mqtt:topic:mosquitto:solarcontrol:frequency2"}

I autogenerated them using the openHAB extention of VS Code

Great, now I have a panel.

I should see data, but the panel show no data, I can clearly see that my solarcontrol sends updates every few minutes.
‘’’
solarcontrol/temp/106D57290208006C {“sensorType”: “owtemp”, “id”: “106D57290208006C”, “name”: “106D57290208006C”, “temp”: 24.8125, “time”: 1602814381832424217, “valid”: true}
solarcontrol/temp/28F29438020000B1 {“sensorType”: “owtemp”, “id”: “28F29438020000B1”, “name”: “28F29438020000B1”, “temp”: 24.9375, “time”: 1602814382938732423, “valid”: true}
solarcontrol/temp/283AA73802000045 {“sensorType”: “owtemp”, “id”: “283AA73802000045”, “name”: “283AA73802000045”, “temp”: 25.125, “time”: 1602814384045108628, “valid”: true}
solarcontrol/rel/rel0 {“sensorType”: “rel”, “id”: “rel0”, “name”: “rel0”, “state”: “OFF”, “time”: 1602814388990994253, “valid”: true}
solarcontrol/rel/rel1 {“sensorType”: “rel”, “id”: “rel1”, “name”: “rel1”, “state”: “OFF”, “time”: 1602814388991876247, “valid”: true}
solarcontrol/rel/rel2 {“sensorType”: “rel”, “id”: “rel2”, “name”: “rel2”, “state”: “OFF”, “time”: 1602814388992488244, “valid”: true}
solarcontrol/rel/rel3 {“sensorType”: “rel”, “id”: “rel3”, “name”: “rel3”, “state”: “OFF”, “time”: 1602814388993078240, “valid”: true}
solarcontrol/flow/flow0 {“sensorType”: “flow”, “id”: “flow0”, “name”: “flow0”, “flow”: 598, “time”: 1602814390663203983, “valid”: true}
solarcontrol/flow/flow1 {“sensorType”: “flow”, “id”: “flow1”, “name”: “flow1”, “flow”: 0, “time”: 1602814390663702980, “valid”: true}
solarcontrol/temp/RTD0 {“sensorType”: “rtd”, “id”: 0, “name”: “RTD0”, “resistence”: 1095.99609375, “temp”: 24.175665838385047, “time”: 1602814414957782785, “valid”: true}
solarcontrol/temp/RTD1 {“sensorType”: “rtd”, “id”: 1, “name”: “RTD1”, “resistence”: 997.1832275390625, “temp”: -0.7068065178316376, “time”: 1602814414959447775, “valid”: true}
solarcontrol/temp/RTD2 {“sensorType”: “rtd”, “id”: 2, “name”: “RTD2”, “resistence”: 993.5089111328125, “temp”: -1.6285761022856236, “time”: 1602814414960870766, “valid”: true}
solarcontrol/temp/RTD3 {“sensorType”: “rtd”, “id”: 3, “name”: “RTD3”, “resistence”: 995.3460693359375, “temp”: -1.167722227305243, “time”: 1602814414962387757, “valid”: true}
solarcontrol/temp/RTD4 {“sensorType”: “rtd”, “id”: 4, “name”: “RTD4”, “resistence”: 995.73974609375, “temp”: -1.0689597815786023, “time”: 1602814414968435720, “valid”: true}
solarcontrol/temp/RTD5 {“sensorType”: “rtd”, “id”: 5, “name”: “RTD5”, “resistence”: 1085.498046875, “temp”: 21.523495834387564, “time”: 1602814414969985710, “valid”: true}
solarcontrol/rel/rel0 {“sensorType”: “rel”, “id”: “rel0”, “name”: “rel0”, “state”: “OFF”, “time”: 1602814419028875785, “valid”: true}
solarcontrol/rel/rel1 {“sensorType”: “rel”, “id”: “rel1”, “name”: “rel1”, “state”: “OFF”, “time”: 1602814419029663780, “valid”: true}
solarcontrol/rel/rel2 {“sensorType”: “rel”, “id”: “rel2”, “name”: “rel2”, “state”: “OFF”, “time”: 1602814419030270776, “valid”: true}
solarcontrol/rel/rel3 {“sensorType”: “rel”, “id”: “rel3”, “name”: “rel3”, “state”: “OFF”, “time”: 1602814419030864773, “valid”: true}
solarcontrol/flow/flow0 {“sensorType”: “flow”, “id”: “flow0”, “name”: “flow0”, “flow”: 598, “time”: 1602814420663178749, “valid”: true}
solarcontrol/flow/flow1 {“sensorType”: “flow”, “id”: “flow1”, “name”: “flow1”, “flow”: 0, “time”: 1602814420663671746, “valid”: true}
solarcontrol/temp/106D57290208006C {“sensorType”: “owtemp”, “id”: “106D57290208006C”, “name”: “106D57290208006C”, “temp”: 24.875, “time”: 1602814445576861764, “valid”: true}
solarcontrol/temp/28F29438020000B1 {“sensorType”: “owtemp”, “id”: “28F29438020000B1”, “name”: “28F29438020000B1”, “temp”: 25.0, “time”: 1602814446682699973, “valid”: true}
solarcontrol/temp/283AA73802000045 {“sensorType”: “owtemp”, “id”: “283AA73802000045”, “name”: “283AA73802000045”, “temp”: 25.1875, “time”: 1602814447788237185, “valid”: true}
solarcontrol/rel/rel0 {“sensorType”: “rel”, “id”: “rel0”, “name”: “rel0”, “state”: “OFF”, “time”: 1602814449065410343, “valid”: true}
solarcontrol/rel/rel1 {“sensorType”: “rel”, “id”: “rel1”, “name”: “rel1”, “state”: “OFF”, “time”: 1602814449066177338, “valid”: true}
solarcontrol/rel/rel2 {“sensorType”: “rel”, “id”: “rel2”, “name”: “rel2”, “state”: “OFF”, “time”: 1602814449066775334, “valid”: true}
solarcontrol/rel/rel3 {“sensorType”: “rel”, “id”: “rel3”, “name”: “rel3”, “state”: “OFF”, “time”: 1602814449067360331, “valid”: true}
solarcontrol/flow/flow0 {“sensorType”: “flow”, “id”: “flow0”, “name”: “flow0”, “flow”: 598, “time”: 1602814450663255531, “valid”: true}
solarcontrol/flow/flow1 {“sensorType”: “flow”, “id”: “flow1”, “name”: “flow1”, “flow”: 0, “time”: 1602814450663856528, “valid”: true}
‘’’
Thanks for the great help.
Jens

So its all working? My german not good

Please use code fences - sandwich your code between three back ticks: ```

```
like this
```

Here you have shown that your solarcontrol Thing is inside your MQTT bridge definition. But in your OP you mention that you also use zigbee2mqtt, and that it works. Are your zigbee2mqtt Thing configurations inside the same MQTT bridge? Or have you defined a second one, and given it a different name?

Where are these lines copied from: output from your solar device, or output from Mosquitto? (Have you confirmed that your solar device is connected to Mosquitto?)

Yes, I have my solarcontrol in the same bridge as the zigbee2mqtt. It is the same mqtt broker.
Now the panel is working but no MQTT data is shown in the panel…
I try to fix it…

I keep you informed…

Thanks fpr the great help!
Jens

I just restarted openhab2 and the panel is working.
Great…

Now I can implement the switches - Great!!!

I leave the cosmetics like formatting out for the moment…

denominator told me that he generated the items…
Is there a tutorial about the VS code?
I also use openhab extensions, but I have no idea how to use it properly.

Thanks!!!
Jens

PaperUI is designed for administering openHAB itself, it shouldn’t really be used for controlling your devices. Use Sitemaps (displayed in BasicUI or the phone apps) for controlling your devices, or HABPanel. There you can change the formatting easily!

1 Like

In vscode open an items file. Goto extention and right click on a thing and then create items from thing.

Yeah and after changing mqtt things sometimes you need a restart.

Thanks again, I installed openhab in visual studio, I try to generate the items next time.

Yes, it works perfect. Still a lot to do. My solarcontrol needs also some work, I just will use openhab to monitor the device to get errors when something gets wrong. The device should work even when OH2 is down.

If you are interessted I would share the complete solarcontrol project. Schematics and also the python code. It uses mostly SMD parts and breakout boards from china that are making the RTD conversation. (PT1000 or PT100) in 4 wire configurations.

Jens

1 Like