10-25-2021, 07:50 PM
OK, well I'm starting to make some positive progress so hopefully I'll be able to help. I now have the basic status of On or Off showing in a Boolean field and can turn the connected light on/off. The next big hurdle is going to be parsing the larger status elements in the JSON text fields and getting to the desired value or values... Thankful for what you, Znelbok and sic0048 have shared as examples or I would be completely lost.
Although I may need to tweak a bit further. Here is what is working for my Shelly RGBW2 in color mode:
First set is for the reading/storing of the on/off. Second set is the actual sending of the command.
Also attaching a screenshot of MQTT Explorer for reference.
Although I may need to tweak a bit further. Here is what is working for my Shelly RGBW2 in color mode:
First set is for the reading/storing of the on/off. Second set is the actual sending of the command.
Code:
<?xml version="1.0" encoding="US-ASCII"?>
<!DOCTYPE MQTTCfg PUBLIC "urn:charmedquark.com:CQC-MQTTCfg.DTD" "CQCMQTTCfg.DTD">
<MQTTCfg Version="1" MQTTPort="1883" MQTTAddr="<server address here>" UserName="****" Password="****">
<Fields>
<Generic Topic="shellies/KitchenUnderCabinet/color/0" BaseName="KitchenUnderCabinetStatus" Access="R" FldType="Boolean">
<PLFmt Type="BinText"/>
<BoolTextMap FalseOut="off" TrueOut="on">
<BoolTextVal TarVal="False" MQTTVal="off"/>
<BoolTextVal TarVal="True" MQTTVal="on"/>
</BoolTextMap>
</Generic>
<Generic Topic="shellies/KitchenUnderCabinet/color/0/command" BaseName="KitchenUnderCabinetCMD" FldType="String" Retain="No" Access="W">
<PLFmt Type="BinText"/>
<EnumMap>
<EnumVal FldVal="off" MQTTVal="off"/>
<EnumVal FldVal="on" MQTTVal="on"/>
</EnumMap>
</Generic>
</Fields>
</MQTTCfg>
Also attaching a screenshot of MQTT Explorer for reference.
-Mike G