Hi all,
I’m using a NodeMCU to report temperatures over Mqtt. Every now and then it misses a reading and the GUI shows me ‘Unknown’ as value. It would like it to just tell me what the last successfull reading was, is that possible?
Ignore 'Unknown' readings via Mqtt
Hi all,
I’m using a NodeMCU to report temperatures over Mqtt. Every now and then it misses a reading and the GUI shows me ‘Unknown’ as value. It would like it to just tell me what the last successfull reading was, is that possible?
Hi,
i have a mqtt-sensor to reading my “Gasuhr”. My Variable- Device dont work with the values of the mqtt-sensor and say “no number…”! With a rule write i when change the value in a variable.
When $id-gasuhr.Zählerstand changes then set $id-Gasuhr-number = $id-gasuhr.Zählerstand
$id-gasuhr.Zählerstand – mqtt-sensor
$id-Gasuhr-number – variable
I think that would work for you. Test it.
MfG, Jens.
Pimatic, my hobby.
@jens That makes so much sense, why didn’t I think of that? Thanks a lot!
I cheered too early. The variable gets changed to ‘Unknown’ as well…
@fregger said in Ignore 'Unknown' readings via Mqtt:
Every now and then it misses a reading and the GUI shows me ‘Unknown’ as value.
I am wondering what is causing this behaviour. Does pimatic receive a null value from the MQTT publisher (NodeMCU)?
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
Maybe its because the retain-flag is not set.
I have the same issues with some of my sensors. On every start of Pimatic i get errors.
If Pimatic subscribes to the Broker, the Buffer of the Broker is emty and Pimatic gets no value.
I don´t know if this is really the reason, just an idea…
@michael-rudek How do I set the retain-flag?
Its just an idea, i don´t know if it is really the reason!
You have to set the retain flag in your sensor/actuator/whatever.
You can´t set it in pimatic. There is a discrete bit that you can set in Pimatic, but that doesn´t help, i tried it already.
@mwittig This is what mosquitto_sub gives me at those moments: {“t”:nan,“h”:nan}