MQTT Hub/Gateway

This time I had to restart the trio, although no errors in the log, and the hub and client were reporting it’s activities the broker seemed to be frozen. However, there are no problems since.
Information log reports something which maybe comes close to the null value:
20210330-18:55:05 message: with value: [object Object]
Cannot judge what this should be it’s a part of the energy meter data of which one of the measures is not working.
(Running Hub in custom mode)

@Robert_Zwetsloot Are you able to provide some more detailed logging?

See pattern below
20210330-18:56:36 Homie set value [kaifa-kaifa-meter.measure_power]: 596
20210330-18:56:35 message: with value: [object Object]
20210330-18:56:26 message: kaifa-kaifa-meter/measure-powerl3 with value: 118
20210330-18:56:26 message: kaifa-kaifa-meter/measure-powerl1 with value: 410
20210330-18:56:26 Homie set value [kaifa-kaifa-meter.measure_power.l3]: 118
20210330-18:56:26 message: kaifa-kaifa-meter/measure-power with value: 586
20210330-18:56:26 Homie set value [kaifa-kaifa-meter.measure_power.l1]: 410
20210330-18:56:26 Homie set value [kaifa-kaifa-meter.measure_power]: 586
20210330-18:56:16 message: kaifa-kaifa-meter/measure-powerl3 with value: 117
20210330-18:56:16 message: kaifa-kaifa-meter/measure-powerl1 with value: 378
20210330-18:56:16 message: kaifa-kaifa-meter/meter-powerconsumedt2 with value: 24742.23
20210330-18:56:16 message: kaifa-kaifa-meter/measure-power with value: 596
20210330-18:56:16 Homie set value [kaifa-kaifa-meter.measure_power.l3]: 117
20210330-18:56:16 Homie set value [kaifa-kaifa-meter.measure_power.l1]: 378
20210330-18:56:16 Homie set value [kaifa-kaifa-meter.meter_power.consumed.t2]: 24742.23
20210330-18:56:16 Homie set value [kaifa-kaifa-meter.measure_power]: 596
20210330-18:56:06 message: kaifa-kaifa-meter/measure-powerl3 with value: 118
20210330-18:56:06 message: kaifa-kaifa-meter/measure-powerl1 with value: 398
20210330-18:56:06 message: kaifa-kaifa-meter/measure-power with value: 609
20210330-18:56:06 Homie set value [kaifa-kaifa-meter.measure_power.l3]: 118
20210330-18:56:06 Homie set value [kaifa-kaifa-meter.measure_power.l1]: 398
20210330-18:56:06 Homie set value [kaifa-kaifa-meter.measure_power]: 609
20210330-18:56:05 message: with value: [object Object]
20210330-18:55:56 message: kaifa-kaifa-meter/measure-powerl3 with value: 116

@Robert_Zwetsloot That’s strange. All capabilities are so called ‘value types’ (not objects) as far as I know.

Can je provide a screenshot of your configuration?
For completeness: did you try the test version of the MQTT Client?

@Robert_Zwetsloot Can you report the non-working sensor value from here: Homey Developer

1 Like

Client v2.4.2
non working value :

Set up:


Version 3.1.6

  • Logging: parse objects to JSON string for debugging puposes

@Robert_Zwetsloot It’s probably an incoming message. Do you know where it comes from? And another strange thing is the topic the message is send to is empty?

it is an incomming message , it is in the middle of the Kaifa message set, Kaifa is a Slimme meter P1 energy meter. Data is provided every 10 seconds by:

Will install Version 3.1.6

V 3.1.6 log
You see 2 lines the old empty object and a new one with value 182 without a topic:

20210330-20:25:28 Homie set value [kaifa-kaifa-meter.measure_power]: 773
20210330-20:25:19 message: with value: “182”
20210330-20:25:18 message: with value: “[object Object]”
20210330-20:25:18 message: kaifa-kaifa-meter/measure-powerl3 with value: “119”

could’nt find the value 182 in the devices values on that moment

@Robert_Zwetsloot I can reproduce the issue by sending an JSON value to a device capability set topic. E.g. { "value": 99 }.
The Hub can only read raw values (99) from the message payloads, this is based on the Homie convention.

This is also why I added the JSONPath config to the MQTT device, so you can optionally add a custom device and configure it yourself if needed.

I will extend the logging.

Version 3.1.7

  • Skip messages not meant for the HUB

Little explenation: The log was coming from a message send to a topic not bound to a device capability (hence the empty topic). With this update the hub detects these message earlier in the process and does an early termination.

Wow, what a huge pace of releasing new, further improved versions!
Cheers for your effort and time, @HarriedeGroot!

Hope I didn’t slow down to many Homeys this evening by the many broadcasts performed after each update :sweat_smile:

2 Likes

Apart from some decreased waf because of window coverings that went up-down and up again due to the broadcasts, it’s all good :slight_smile:

Thanks for your efforts and the updates!

Solved: Empty topic message is no longer visible.

Version 3.1.8

  • Fix for Home Assistant Entity names (removed device name)

Should solve this issue: $name on switches · Issue #24 · harriedegroot/nl.hdg.mqtt · GitHub

Unfortunately, the problem has not yet been resolved.

@Undertaker Reverted.

Version 3.1.9

  • Reverted HA name change

:+1: Works ! Thank you.