AaronLionsheep / ShellyMQTT

IndigoDomo Plugin that interfaces with Shelly devices over MQTT.
MIT License
0 stars 0 forks source link

Sensor add-on identifier targeting #110

Closed AaronLionsheep closed 3 years ago

AaronLionsheep commented 3 years ago

It appears there is no standard for which sensors are exposed as channels 1-3, so it might be necessary to target a sensor by its unique identifier.

There is a topic shellies/<model>-<deviceid>/ext_temperatures which publishes the data:

{
    "0":{"hwID":"XXXXXXXX","tC":20.5},
    "1":{"hwID":"YYYYYYYY","tC":21.5},
    "2":{"hwID":"ZZZZZZZZ","tC":22.5}
}

There is also a topic shellies/<model>-<deviceid>/ext_humidities which publishes the data:

{
    "0":{"hwID":"XXXXXXXX","hum":50}
}

One solution could be to pivot to subscribing to these topics and parsing the json. The device channel dropdown could be enhanced to allow the user to select a specific channel, or to allow the selection of an identifier. Logic to determine if the channel or identifier was selected would be needed to determine how to process messages from the new topic.

Required Changes