Hi
I have an ESP12 board with a pair of DS18B20 temperature sensors on GPIO2 - the MQTT input node returns an object including names DS18B20-1 and DS18B20-2 which I cannot seem to extract to get values out.
I noted on the web someone published a rule, slightly modified here but you get the idea.
Rule1 on DS18B20-1#temperature do publish stat/mosfet/DS18B20a %value% endon on DS18B20-2#temperature do publish stat/mosfet/DS18B20b %value% endon
Rule1 1
It works - I can extract DS18B20a and DS18B20b and get their temperature values but the MQTT input node insists on pulling in data every second (no idea why) so I end up having to use rate limiting (delay node).
Any ideas as to a better way? I only need to read the temperature once a minute at most.. standard TELE response rates would be fine.
No it doesn't. The MQTT In node does not pull data, it gets pushed data from the mqtt broker. If the MQTT In node is giving you data every second then the publisher if publishing data at that rate, so you should fix it at that end. If you do not believe this is the case then install MQTT Explorer to check.
It looks as if you might be using ESPeasy firmware on the ESP12.
If so, you can specify how often to send readings by setting a value for 'Interval' in the 'Devices tab'...
@scargillSetOption64 can be used to switch from default.legacy _ instead of - in JSON keys
The default to use - is an unfortunate choice but it was decided not to break what was existing and offer the ability to change it by choice.
Thanks - the brackets-quotes solution works a treat. I am however using a cmnd to get a stat reading back - and though it works prefectly and I need to do it that way, I'm wondering what I was doing wrong with my TELE MQTT input as after a few minutes I wasn't seeing anything... I thought tele/mosfet/sensor would do it - but nothing.
Oh I seee - yes I'll look ta... though in the end I need more control than the tele message will give. Got to turn the pump on if it's not cold, wait a bit to find out if the hot pipe is warmer than the cold pipe, then keep the pump on if it is.... until it isn't
TelePeriod See current value and force publish STATE and SENSOR message 0 = disable telemetry messages 1 = reset telemetry period to firmware default (TELE_PERIOD) 10..3600 = set telemetry period in seconds (default = 300)