CyberHome
(Michael)
1
Try to set up an automation based on MQTT.
This works well as with several values but one is driving me crasy.
Via MQTT I get json as following:
{“Time”:“2023-12-26T22:44:50”,“RfReceived”:{“Sync”:13050,“Low”:460,“High”:1260,“Data”:“0E0443”,“RfKey”:“None”}}
In automation I add (and the same is true via automation.yaml)
After saving it and do a try run it looks like this:
Tried it via automation.yaml but also there the 0E0443 is marked in blue with the same effect.
Reopen the file and it turned to 0
Found meanwhile that 0E0 in json is equal 0, need therefore a workarround that this not interpreted…
Source: Is 0E0 a valid JSON number - Stack Overflow
Any hint or workarround would be nice.
Thank you in advance
Cyberhome
Dujith
(Charles Evers)
2
Plz format the yaml code, helps debugging a lot more then screenshots.
Your payload:
{"Time":"2023-12-26T22:44:50","RfReceived":{"Sync":13050,"Low":460,"High":1260,"Data":"0E0443","RfKey":"None"}}
Has the Data
as a string, note that 0E0443
is between quotation marks, so you just need to quote the payload.
payload: "0E0443"
CyberHome
(Michael)
3
Dear @Dujith
THX it works well, still not got why in the other cases the “” where not necessary.
May I send you a “Glühwein” ?
Best Regards
CyberHome
Dujith
(Charles Evers)
4
The other cases might have been presented as a number.
And no thnx, i’m driving atm.
CyberHome
(Michael)
5
Thank you, thank you, thank you,
May I spend you a “Glühwein” ?
Best Regards
CyberHome