Help with my first automation

Hello,

I’m new in home assistance and look for help with some simple automation.

As the weather is becoming worse in the Netherlands we need to dry our clothes in house. To get things dry in reasonable time my plan is to use a blower what I switch on and off with a fibaro plug. This plug I switch with fibaro homecenter 2 and on and off manual is working ok.

Now the issue.

I like to use a timer to switch on with a helper “input_boolean.wasrekje_droger”. When I switch on it will switch the output “switch.garage_wasrekje_171” for a specified timer. I tried to do by

timers

timer:
wasrek_ventilators:
duration: ‘01:00:00’
name: wasrek droogtimer
icon: mdi:tumble-dryer

In the config file and then with automation start the timer.

alias: start wasrek drogertimer
description: ‘’
trigger:

  • platform: state
    entity_id: input_boolean.wasrekje_droger
    from: ‘’‘off’’’
    to: ‘’‘on’’’
    condition: []
    action:
  • service: timer.start
    data: {}
    entity_id: timer.wasrek_ventilators
    mode: single

Then I have 2 problems:
• The times will not start when I switch on the helper.
• And to change the timer I need to update the config file.

My wish is to have a timer I can adjust in the frontpanel (e.g. between 0,5 and 3 hours)and when I then switch on the helper input_boolean.wasrekje_droger it will run until timer end or until I switch of the helper.

I like to ask if someone can help me with this automation

Please see the sticky post for how to format code.

A solution to your second problem using an input_number to dynamically change the timer duration.

Dear Tinkerer,

Thanks for comment. I learn :slight_smile:

  description: ''
  trigger:
  - platform: state
    entity_id: input_boolean.wasrekje_droger
    from: '''off'''
    to: '''on'''
  condition: []
  action:
  - service: timer.start
    data: {}
    entity_id: timer.wasrek_ventilators
  mode: single

try removing all of those quotes but one from the from & to:

description: ''
  trigger:
  - platform: state
    entity_id: input_boolean.wasrekje_droger
    from: 'off'
    to: 'on'
  condition: []
  action:
  - service: timer.start
    data: {}
    entity_id: timer.wasrek_ventilators
  mode: single
1 Like

I’m pretty sure those extra quotes are put in by the UI automation editor.
I’ve noticed the extras in some on my automations and removed them.
Not sure why some and not others.

1 Like

I’ve seen it escape single quotes by using an extra single quote:

from: ''off''

but I’ve haven’t seen any examples of it escaping two single quotes with another single quote like the OP posted. But then again, I never use the UI editor so I could be completely wrong. I’m just going by examples I’ve seen posted here.

So there may be something confusing the system by having a double-escaped single quote.

Actually, your right.
My experience was the same as your example with two single quotes.

1 Like

I used the automation editor and copied the code in here and there the quotes were. Removed them in the file editor and it is working :slight_smile:

Thanks