Automation issues [SLOVED]

Thanks so much for taking the time and for your patience i really appreciate it!

I have a simple one state 433Mhz pir sensor, I use the OpenMQTTGateway I can see the messages in MQTT broker.

The PIR sensor works fine the state is changing from on to off after 10 seconds like it should (I use an automation to change it from on to off after 10 seconds)

I see the light switch turn yellow in the HASS interface and that the automation was triggered

The light turns on without a problem from Alexa/manually/clicking the switch in HASS/clicking on the automation trigger

The conditions are not important because the same issue occurs when there are no conditions at all.

My configuration file is splitted

binary_sensor.yaml configuration:

- platform: mqtt
  name: "Study room Motion Sensor"
  qos: 0
  state_topic: "home/433toMQTT"
  payload_on: "2645158"
  payload_off: "2645158off"
  device_class: motion

My automations.yaml configuration:

- alias: 'Study room Motion Sensor Off Timer'
  initial_state: 'on'
  trigger:
    platform: state
    entity_id: binary_sensor.study_room_motion_sensor
    to: 'on'
    for:
      seconds: 10
  action:
    service: mqtt.publish
    data:
      topic: 'home/433toMQTT'
      payload: '2645158off'
      retain: 'true'

- alias: Study room Motion Sensor Light ON
  initial_state: 'on'
  trigger:
    platform: state
    entity_id: binary_sensor.study_room_motion_sensor
    to: 'on'
  condition:
    - condition: state
      entity_id: group.g_shai_tracker
      state: 'home'
    - condition: state
      entity_id: group.g_alina_tracker
      state: 'home'
  action:
    service: switch.turn_on
    entity_id: switch.study_room_light

You can see in the screenshots that the automation worked (for the interface at least) but the light didnā€™t turned on

@rpitera OK, I think i found a workaround for this issue, i have done some testing and so far so good

Iā€™m calling the service twice with a delay of 1 second

- alias: Study room Motion Sensor Light ON
  initial_state: 'on'
  trigger:
    platform: state
    entity_id: binary_sensor.study_room_motion_sensor
    to: 'on'
  condition:
    - condition: state
      entity_id: group.g_shai_tracker
      state: 'home'
    - condition: state
      entity_id: group.g_alina_tracker
      state: 'home'
  action: 
    - service: switch.turn_on
      entity_id: switch.study_room_light
    - delay: 00:00:01
    - service: switch.turn_on
      entity_id: switch.study_room_light
1 Like

I would post an issue in Github so you can see why this workaround works and if itā€™s a bug or not. I confess that I have had the same issue with some cUrl commands I send to my Foscams and I ended up using the same workaround; namely sending the commands twice.

Iā€™m glad you found a hack but Iā€™m sorry I couldnā€™t have been more helpful.

Just upgraded to 0.48 and guess what ?

Itā€™s not working againā€¦lolā€¦:grimacing:

Shit.

BTW, I just realized it was a release week and was looking at the notes when you replied.

Is your sensor a Zwave device? Did you put in the option to use the old entity names?

That might be it.

No itā€™s a binary mqtt sensor component and my pie sensor is rf

Just a thought.

Iā€™m upgrading here, let me see if anything pops outā€¦