Can´t get automation to trigger

It returns True.

Good! That means the template works properly.

When the Template Binary Sensor uses that template it will report True as on and False as off. Those are the two states you can use for triggering an automation.

washing%20snip

Usually not 0.00W

Ok, so changing back to True again. Any other ideas? I thought this should be an easy one… :slight_smile:

no don’t switch it to ‘true’. leave it to ‘on’. that’s what @123 was telling you.

A binary sensors reports its state as on or off. Just look in the States page and you’ll see that. Your automation’s trigger should use on.

binary_sensor:
  - platform: template
    sensors:
      washingmachine_idle:
        friendly_name: 'Washing Machine Idle'
        entity_id: switch.tvattmaskin
        value_template: "{{ state_attr('switch.tvattmaskin', 'current_power_w') | replace(' W', '') | float < 1.5 }}"


automation:
  alias: wm_done
  trigger:
    platform: state
    entity_id: binary_sensor.washingmachine_idle
    to: 'on'
  action:
    service: notify.ios_ivans_iphone
    data:
      title: "Washing is done."
      message: "Washing machine stopped."

while you are on the states page look to see what the current state of your “binary_sensor.washingmachine_idle” is? on or off? and does it exist?

I was wondering if the syntax of the template might be an issue. That’s why I was asking for that screen shot just to verify it wasn’t reporting in some weird json format that needed the square brackets.

washing%20idle%20snip

Yeah, nothing but the string True returns. No markup or any other chars.

I found a lost “binary_” in my text. Got overwritten in a save somehow, I guess. Testing that now. Again with your above ideas. Hold on :+1:

did you ever verify that the automation state was ‘on’? i don’t see an answer to that question i asked above.

Sorry, I replied with a screenshot of the state page entity, showing the binary_sensor as on. Maybe you searched for something else?

I amtracking the psuedo binary sensor as icon in home assistant card and it changes from on to off and back to on again as intended.

Is it possible to get extended log information? Right now it doesn´t show triggers etc…?

not the state of the binary_sensor. I saw that.

I wanted to know the state of the “automation.wm_done”.

Ok, great thinking. It has not triggered today:

[automation.wm_done] | on | last_triggered: 2019-04-13T19:13:59.164771+00:00 friendly_name: wm_done

What does it mean that an automation is “on”?

well, crap.

The automation is actually on. i was hoping it was off because that would have been a really easy fix (i.e. turn it on).

now we need to do more troubleshooting.

Hehe, ok so the “on” tag for automation is simply if its active/listening or not.

Well all help is greatly appriciated! :slight_smile:


I am not allowed to post more posts today obviously :slight_smile:

Reply to your below question:

It´s psuedo just because it does not exist in reality. It´s a binary sensor that I have created myself for this prupose. It is the same sensor mentioned everywhere - I have no other sensors in this automation.

Meaning I have a switch with energy monitor, that I use as a imaginary binary sensor - on when under 1.5W, off when above. Then I use that sensor for triggering the push… Well so I thought…

I guess I´ll be back tomorrow when I am welcome by the system again :slight_smile:

what is that? is that different than the other binary sensor that you listed above?

yes

Ok I just wanted to make sure we were all on the same page.

and that’s strange. i didn’t realize there were limits on posting like that for users.

see you tomorrow then! :smile:

1 Like

Edit: just realised you are using a binary sensor instead of an input_boolean. Never mind my remarks, still you might get some inspiration from the examples below :relaxed:

I see an automation for turning on the input_boolean ‘Washing machine idle’, but I don’t see an automation for turning it off again. If it remains ‘on’ all the time, it will never trigger the automation.

Did you manually turn off the input_boolean before each test run? You’ll also need some logic for that part in your automation.

Here’s my stuff for inspiration, it’s been working perfectly:

Template sensor:

  - platform: template
    sensors:
      washer_pwrdn:
        value_template: "{{ states('sensor.plug_wasmachine_power') | int < 3.4 }}"

Input boolean:

input_boolean:
  washer_status:
    name: Status wasmachine
    initial: off

Automations:

- alias: Wasmachine start
  trigger:
    platform: state
    entity_id: sensor.washer_pwrdn
    from: 'True'
    to: 'False'
  action:
    service: input_boolean.turn_on
    entity_id: input_boolean.washer_status

- alias: Wasmachine ready
  trigger:
    platform: state
    entity_id: sensor.washer_pwrdn
    from: 'False'
    to: 'True'
    for:
      seconds: 90
  condition:
    condition: state
    entity_id: input_boolean.washer_status
    state: 'on'
  action:
  - service: notify.by_telegram
    data:
      message: De wasmachine is klaar.
  - service: input_boolean.turn_off
    entity_id: input_boolean.washer_status
1 Like

but it will write a warning in log file, won’t it?