Ad Widget

Collapse

MQTT plugin issue with JSON

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • 086jysgxy
    Junior Member
    • Aug 2023
    • 1

    #1

    MQTT plugin issue with JSON

    Hi,
    I have a complex setup where I monitor several components (rtl433, Zigbee ...) via MQTT with VerneMQ.
    That MQTT is translated into zabbix y syslog data, so it can be reported on. I was using py-zabbix script, but it broke on debian12 updates, so I decided to migrate to MQTT native zabbix plugin instead, an avoid the middle man.
    While the plugin is great, I've encounter a few issues:
    • Can't seem to be able to subscribe to 2 different topics from the same broker. Last subscription seems to take over..
    • JSONpath doesn't seem to work after the first level:
      • {"zigbee2mqtt_WC/Salon - Temperatura 5":"{"battery":100,"humidity":64.45,"linkqual ity":68,"power_outage_count":23837,"temperatur e":23.65,"voltage":3005}"} this is the message
      • $.["zigbee2mqtt_WC/Salon - Temperatura 5"] this works and returns {"battery":100,"humidity":64.45,"linkquality":6 8," power_outage_count":23837,"temperature":23.65,"vol tage":3005} , which is OK.
      • $.["zigbee2mqtt_WC/Salon - Temperatura 5"]. ["temperature"] doesn´t work
      • If I create a new dependent item with $.["temperature"] , this works OK.
      • I've tried multiple combinations and can´t seem to find the issue with my configuration, but I'm no expert on JSON.
    Appreciate any help you can give me, or point to the right direction. All zabbix components and MQ are updated to the latest and I can verify the message via MQTT explorer.​
Working...