When state changes to same state

Hi!

Can someone please tell me if there is any chance to make an automation which triggers everytime when a sensor state change even if the state is the same like last time? Let’s say that I have a device which send the state every 1 minute. Now is “OFF” state", but I want to trigger even if the device will send “OFF” state again, not only different than “OFF” :smiley: Hope you can understand what I said here…

Thank you!

Or maybe to trigger when MQTT receive something? I have a door sensor and I want to trigger something even when the state sent is from OFF to OFF … I don’t know to explain it better :frowning:

If state was off and becomes off, there is no state change. Bur you night try an mqtt trogger.

Can you explain me more? Thanks!

Like nickrout said, if the state did not change, then there will be no state change. Example: if a sensor has a value of 0 at 13:00:00, it will be 0 with that time stamp until it is no longer 0. If a device sends an update and the sensor is still at 0, HA interprets this as the sensor has not changed.

Short answer, try an mqtt trigger

I’m very new to mqtt, If you can help me with stright information, it will be great. I don’t understand how should I aproach this

This is my binary sensor for getting the door sensor on/off state… But I want to refresh the state even if I get the second state similar with the first state…

- platform: mqtt
  state_topic: "tele/RF_Bridge/RESULT"
  name: "Kitchen Door"
  value_template: "{{value_json.RfReceived.Data}}"
  payload_on: "BNNBC84E"
  payload_off: "BNNBC847"
  device_class: door
  qos: 1

Oh, wait, I think I know what you say… About creating an automation with the trigger of MQTT, and ok, yes, right, sorry, i’m stupid :smiley: Thanks, I will try more

1 Like

Ok, this is very very new to me… I don’t know what to write on payload, to trigger if I get the same payload from the binary sensor :frowning:

This is what I tried, but it is not working, as a trigger:

platform: mqtt
topic: tele/RF_Bridge/RESULT
payload: value_json.RfReceived.Data == "8N1NCD47"

Solved with:
{{ trigger.payload_json['RfReceived']['Data'] == "8N1NCD47" }}

Done for tonight :smiley: