After the recent updates I’ve had an issue with my automation’s not working i will attach my config and automation for examination, hopefully someone will be able to tell me if/where i have made a mistake.
Thanks in advance for any help/advice.
binary_sensor:
- platform: mqtt
state_topic: "tele/RF_Bridge/RESULT"
name: 'Hallway Motion'
value_template: '{{ value_json.RfReceived.Data }}'
payload_on: 'E5D30E'
payload_off: 'E5D30Eoff'
device_class: motion
qos: 1
- platform: mqtt
name: "Bathroom Door"
state_topic: "tele/RF_Bridge/RESULT"
value_template: '{{ value_json.RfReceived.Data }}'
payload_on: "2C8D0A"
payload_off: "2C8D0E"
device_class: Door
qos: 1
- alias: light on
trigger:
- platform: state
entity_id: binary_sensor.hallway_motion
to: 'on'
for:
minutes: 5
condition:
- condition: or
conditions:
- condition: sun
after: sunset
- condition: sun
before: sunrise
action:
- service: switch.turn_on
data:
entity_id: switch.hallway_light
- alias: Bathroom door
trigger:
- platform: state
entity_id: binary_sensor.bathroom_door
to: 'on'
for:
minutes: 5
condition:
- condition: or
conditions:
- condition: sun
after: sunset
- condition: sun
before: sunrise
action:
- service: switch.turn_on
data:
entity_id: switch.bathroom_light
Did you make a mistake copy-pasting the automations or is that the way they are actually formatted in your configuration file? The indenting is all wrong.
I copy-pasted your two automations into Home Assistant and they failed to pass Config Check.
I don’t know how those two automations ever worked as shown above. It’s not a matter of Home Assistant’s version, they are simply not in valid YAML format.
Here are your two automations in valid YAML format and they pass Config Check.
- alias: light on
trigger:
- platform: state
entity_id: binary_sensor.hallway_motion
to: 'on'
for:
minutes: 5
condition:
condition: or
conditions:
- condition: sun
after: sunset
- condition: sun
before: sunrise
action:
- service: switch.turn_on
data:
entity_id: switch.hallway_light
- alias: Bathroom door
trigger:
- platform: state
entity_id: binary_sensor.bathroom_door
to: 'on'
for:
minutes: 5
condition:
condition: or
conditions:
- condition: sun
after: sunset
- condition: sun
before: sunrise
action:
- service: switch.turn_on
data:
entity_id: switch.bathroom_light
If you check my two posts, I referred to the automations.
In addition, if the binary_sensors and the automations are all defined within configuration.yaml, as opposed to separate files for binary_sensors and automations, then you must include the automation: domain name before the first line of the first automation. If your automations are held in a separate file then the domain name is excluded from that file.
The automation’s are defined in the automation’s tab in the configurator and like wise with the configuration. What is strange is as mentioned this is copied and pasted from before an update and it all worked perfectly fine. So if possible can you point me in the direction to get it right?
Your automations appear to work like this:
If there’s motion for at least 5 minutes and the time is between sunrise and sunset then turn on a light. If that’s not the behavior you want then you’ll need to change it.
I would first need to see the configuration for Hallway Motion. However, my guess is the payload you are receiving via tele/RF_Bridge/RESULT contains something unexpected. The sensor expects to receive whatever you specified in payload_on and payload_off but is receiving something else.
You have two sensors subscribed to the same topic, tele/RF_Bridge/RESULT, because that one topic can contain information that is pertinent to either sensor.
Let’s say the tele/RF_Bridge/RESULT contains data that pertains to the Bathroom Door sensor. In other words, value_json.RfReceived.Data contains either 2C8D0A or 2C8D0E. Hallway Motion sensor receives the same data but it, of course, fails to match what it expects to receive ( payload_on: 'E5D30E', payload_off: 'E5D30Eoff'). As a result, Home Assistant reports the mismatch with the WARNING message: No matching payload found for entity: Hallway Motion with state_topic: tele/RF_Bridge/RESULT
There’s a very long thread discussing this issue here:
I can’t help you unless you provide details. “no joy” only tells me it didn’t work. It may be as simple as the indenting was wrong after you copy-pasted the example.
It wont switch the light via the sensor itself or the state change in hass, im really trying to not be to stupid and solely rely on you to fix this for me just been having this issue for about 6 weeks now.
In order to help you, you have to help me first. You help me by providing detailed information. Without you telling me more about what you are observing, I don’t have enough information to help you.
For example, when things don’t work at all or not as you expected, the first thing to confirm is that your configuration is valid and there are no unusual messages in the log.
When you run Config Check does it pass or fail?
Are there any new WARNING or ERROR messages in Home Assistant’s log?
I have had the same problem with Automation not working after recent updates.
I narrowed it down to using ‘Sun’ in the Conditions. Try replacing Sun with a specific Time range and see if that works.