Sensor updated to binary.sensor and now not automatically triggering automation in 99

In v98 the Jewish_calendar platform had an “issur_melacha_in_effect” sensor which at specific times changed state from True to False and vice-versa.

I had two automations which when the sensor went true turned on a relay and when it went off turned the relay off.

In v99 the platform changed and “issur_melacha_in_effect” became a binary.sensor with an On/Off state.

I changed the automations to reflect the On/Off states, and when tested by manually changing states worked correctly.

However, when the binary.sensor changed states on Friday the automations failed to trigger.

I did some manual state change and the automation fires when I manually sent the On state. However within 30 seconds the system swaps the state back to the default Off state but the Off automation doesn’t fire and turn the relay off.

If I quickly manually turn the state Off the automation fires.

This is only for v99 as I restored back to 98 and everything works correctly.

Is there something else I am missing between using a sensor and a binary.sensor?

Mike Paneth

You forgot that nobody here can read minds :wink:

You’ve described, vaguely, the problem, but you’ve not provided any of the required details - see here. Without seeing the automations at the very least we can only guess.

That said, I’d guess you are using Off and On for the states since that what you posted above. That’s not right - look in Developer toolsStates to see the actual states you should be using.

Sorry for taking so long to respond, but I have been experimenting to see if I can resolve the issue myself.

It seems that just changing the Entity from “Sensor” to “Binary Sensor” and then changing the “From” and “To” to on and off does not work.

I now have the automations working by deleting them and then re-creating them.

Not sure why, but they now work.

The new automations are

  • id: ‘1554409277939’
    alias: Shabbos_Yomtov_ON
    trigger:

    • entity_id: binary_sensor.jewish_calendar_issur_melacha_in_effect
      platform: state
      to: ‘on’
      action:
    • data:
      entity_id:
      • group.Shabbos_relay
        service: switch.turn_on
  • id: ‘1554409849922’
    alias: Shabbos_Yomtov_OFF
    trigger:

    • entity_id: binary_sensor.jewish_calendar_issur_melacha_in_effect
      platform: state
      to: ‘off’
      action:
    • data:
      entity_id:
      • group.Shabbos_relay
        service: switch.turn_off