Page 1 of 1
mqtt and json
Posted: 09 May 2021, 16:14
by bledad
hello,
i try mqtt , but in log :
Code: Select all
2543194068: IMPT : Bad Import MQTT Command sdb_statut
2543194069: ERR : Illegal Payload {'relais': {'CLIM': 0, 'RELAIS': 0, 'LED': 0}, 'mode': 'Travail', 'temperature': 22.03, 'consigne': 18.0
i would collect 'RELAIS' 0 or 1 , for variable in rules
can you help
thank's
- mqtt.jpg (62.34 KiB) Viewed 5095 times
Re: mqtt and json
Posted: 09 May 2021, 17:16
by Ath
You will have to wait for
PR #3424 to be finished and merged before you can have that feature. I'm still ironing out some (memory-usage) wrinkles...
Re: mqtt and json
Posted: 09 May 2021, 17:29
by bledad
ok , thank you , i wait
Re: mqtt and json
Posted: 09 May 2021, 18:31
by bledad
it's possible in command line for test ?
ip/control/cmd= (ip broker /subscribe /sdb_statut ) ??
Re: mqtt and json
Posted: 09 May 2021, 18:34
by Ath
Currently, the MQTT Import plugin only can process numeric values, nothing else.
Re: mqtt and json
Posted: 10 May 2021, 09:44
by bledad
it will be possible , when you finish PR #3424 , recover ' RELAIS '= 1 or 0 ?
{'relais': {'CLIM': 0, 'RELAIS': 0, 'LED': 0}, 'mode': 'Travail', 'temperature': 22.03, 'consigne': 18.0
Thank
Re: mqtt and json
Posted: 10 May 2021, 09:56
by Ath
Yes, it will, and also 'translate' values like "Travail" to a 1 and any other values to a numeric equivalence (I'm using to translate off/on/up/down to 0/1/2/3)
Next to that, it can parse the nth value from a multi-value string like "22.0;150;1;0", so requesting the 2nd value would return 150.
Re: mqtt and json
Posted: 10 May 2021, 10:01
by bledad
ok, fantastic , I am impatient