Automation for Sonoff mini using No Flash firmware

Hi,

Implemented a Sonoff Mini recently via links below and am successful in device being controlled in Lovelace, etc however, I have tried several attempts at implementing some sort of automation (even very basic like [sun.sun] as a trigger and nothing I have done at this point will trigger the automation to fire. Not much documentation to look for on this topic that I have found. Others are flashing and using ESPhome or other implementations but nothing specific to implementing automation for this type of configuration. Full disclosure…I have only been playing with HA for about 2 weeks so am still trying to get up to speed. If someone could help steer me in the right direction or even share some code that would be greatly appreciated!

Dr Zz’s no flash:

AlexxIT Sonoff LAN:

Share what you’re trying to do and what you’ve already tried so far.

1 Like

Here is one attempt that does not trigger

Automation attempt for lights

  • alias: Turn on kitchen light when there is movement
    trigger:
    platform: state
    entity_id: binary_sensor.my_home
    to: ‘on’
    action:
    service: light.turn_on
    entity_id: light.sonoff_1000b6cf8b

  • alias: Turn off kitchen light 10 minutes after last movement
    trigger:
    platform: state
    entity_id: binary_sensor.my_home
    to: ‘off’
    for:
    minutes: 10
    action:
    service: light.turn_off
    entity_id: light.sonoff_1000b6cf8b

even though the logs show that it triggered

more screen shots

Few things:

  1. Please format your code properly. Use three backticks ( ``` ) above and below the code.
  2. It looks like your occupancy sensor has been in the on (Detected) state all day. If it doesn’t go from off to on or vice versa, neither automation will trigger.
  3. The state of the automation doesn’t determine if it’s been triggered, it just means it’s active (waiting for the trigger to happen).

Ok this is helpful! So looking at my sensor (after your input) does in fact state detected and never goes off, if I set it to off (see screen shot) and then set to on my trigger does work…now to determine how to get my sensor state to on/off…

image