Create custom timer in ui?

Hello! I’m trying to make an easy way for my wife and me to set custom timers for our cars engine heaters. Got 1 zwave plug for each car.
Seeing we got different times for our work almost every day I’m looking for an easy way to create an off and on timer for the next day.
Anyone got any tips? My wife don’t really wanna mess with node red for example. Tho I got that installed if it Helps.

??

You can use input numbers on HA that go into node red for the automation piece. You configure it once and you don’t need to mess around with it after

That would be awesome. Altho my knowedge is limited with these things… Can I define that slider to be a time stamp? And how would I go ahead and link it to a node in node red?

I don’t know what this means.

Just like you would with any other device in HA? I’m not sure what part is tripping you up.

Here’s what I use for my gym heater. You can easily adapt this to your needs. The front end looks like this:

Screen2018-12-31_02-30-03_pm

sensor:
	####################################
	## Gym Heater Start Timer###
	####################################
	- platform: time_date
	  display_options:
		- 'time'
	- platform: template
	  sensors:
		gym_heater_clock_hour:
		  value_template: '{{ states.input_number.gym_heater_clock_hour.state | int }}'
		gym_heater_clock_minute:
		  value_template: '{{ states.input_number.gym_heater_clock_minute.state | int }}'
		gym_heater_time:
		  value_template: >-
			{{ states.sensor.gym_heater_clock_hour.state }}:
			{%- if states.sensor.gym_heater_clock_minute.state|length == 1 -%}
			  0
			{%- endif -%}
			  {{ states.sensor.gym_heater_clock_minute.state }}
		gym_heater_time_long:
		  value_template: >-
			{% if states.sensor.gym_heater_clock_hour.state|length == 1 -%}
			  0
			{%- endif -%}
			  {{ states.sensor.gym_heater_clock_hour.state }}:
			{%- if states.sensor.gym_heater_clock_minute.state|length == 1 -%}
			  0
			{%- endif -%}
			  {{ states.sensor.gym_heater_clock_minute.state }}

groups:

	# Gym Heater Timer
	  gym_heater_timer:
		name: 'Gym Heater'
		control: hidden
		entities:
		  - sensor.gym_heater_time
		  - input_number.gym_heater_clock_hour
		  - input_number.gym_heater_clock_minute
		  - input_boolean.gym_heater_timer_status
		  - sensor.gym_heater_temperature
		  - switch.gym_heater
		  - sensor.heater_energy

automation:

	## Gym Heater timer ######
	- alias: 'Gym Heater Timer'
	  hide_entity: False
	  trigger:
		platform: template
		value_template: '{{ states.sensor.time.state == states.sensor.gym_heater_time_long.state }}'
	  condition:
		condition: state
		entity_id: input_boolean.gym_heater_timer_status
		state: 'on'
	  action:
		service: script.start_gym_heater

input_boolean

	# Gym Heater Timer #######
	  gym_heater_timer_status:
1 Like

That looks exactly like what i want! I cant code anything but i think i can adopt it!
I should only have to change the alias to my liking and entity ID right?

One thing i really wondering is:

Does this all go in the configuration.yaml or how do i implement it ? Im kinda new to how HA works. :slight_smile:

Yes.

Does this all go in the configuration.yaml

Yes.

Im kinda new to how HA works.

Yes.

Have you read through the configuration documentation and watched some of the excellent beginner video tutorials? If not, your experience with Home Assistant will be unnecessarily frustrating.

I’ve done some reading. But it’s hard to get a grasp of everything obviously :slight_smile: learning new things as I go on and need them.
Gonna try to adapt your config tonight and see if I can get it to work :slight_smile:
Thanks a lot for your help :slight_smile:

This will all work but you’ll need to change some names and, if you’re new to this, the biggest challenge is likely to be indenting!

Install IDE from the add ons store, it makes things a lot easier to edit, and give it a go.

When you get this working you’ll have learnt loads and be ready for your own automations.

You’ll get plenty of help here.

That’s true but Home Assistant’s operation largely revolves around configuration.yaml.

Look at it from the standpoint of the people trying to help you. In your first post you mention using ‘Node-Red’ (a completely separate system from Home Assistant requiring additional user-skills) and in a later post you ask if the example should go in configuration.yaml. Based on these few (contrasting) posts, we don’t know how much or how little you know.

For future reference, what flavor of Home Assistant are you using? Hass.io, Hassbian, in a Docker container, in a venv, etc?

Yeah i understand its hard to help someone who dont know how the system works. Must be frustrating for others.
Will try to read up some more on how it works and learn where things go. atm i get most of my things working based on gudes and alternating examples. Really should learn how the coding works :slight_smile:

Using hassio on my RPI. got node red working and got quite a few automations going there. :slight_smile:

I will do that :slight_smile: Thanks for your help again!
Ill reply here if i get it to work :slight_smile:

@ashscott hi, firstly thanks for the code, but I have a problem with it. I copied it 1:1 and checked it with the webinterface, but it didn’t looked like on your screenshot.
png
Now I adapted some of the parameters, but it still didn’t change anything obviously. Maybe you can help me. My code looks like the following:

sensor:
- platform: time_date
  display_options:
  - 'time'
- platform: template
  sensors:
  bed_warmer_clock_hour:
    value_template: '{{ states.input_number.bed_warmer_clock_hour.state | int }}'
  bed_warmer_clock_minute:
    value_template: '{{ states.input_number.bed_warmer_clock_minute.state | int }}'
  bed_warmer_time:
    value_template: >-
      {{ states.sensor.bed_warmer_clock_hour.state }}:
      {%- if states.sensor.bed_warmer_clock_minute.state|length == 1 -%}
        0
      {%- endif -%}
        {{ states.sensor.bed_warmer_clock_minute.state }}
  bed_warmer_time_long:
    value_template: >-
      {% if states.sensor.bed_warmer_clock_hour.state|length == 1 -%}
        0
      {%- endif -%}
        {{ states.sensor.bed_warmer_clock_hour.state }}:
      {%- if states.sensor.bed_warmer_clock_minute.state|length == 1 -%}
        0
      {%- endif -%}
        {{ states.sensor.bed_warmer_clock_minute.state }}

group:
 bed_warmer_timer:
name: 'Wärmematte'
control: hidden
entities:
  - sensor.bed_warmer_time
  - input_number.bed_warmer_clock_hour
  - input_number.bed_warmer_clock_minute
  - input_boolean.bed_warmer_timer_status
  - light.lichterkette

   automation:
 - alias: 'Wärmematte Timer'
hide_entity: False
trigger:
  platform: template
  value_template: '{{ states.sensor.time.state == states.sensor.bed_warmer_time_long.state }}'
condition:
  condition: state
  entity_id: input_boolean.bed_warmer_timer_status
  state: 'on'
action:
  service: script.start_bed_warmer

input_boolean:
 bed_warmer_timer_status:

The spaces in this quote aren’t the same as the ones in my config, it dind’t work to properly format it here. I hope you can help me.

Have you copied it all into one .yaml file or is it split across the group, sensor, input_boolean and automation files?

@ashscott I copied it all in in the configuration.yaml

@ashscott the strange thing is, that the sliders doesn’t even show up

Do you have separate group, sensor, input_boolean files?
Did it pass config check?

You need to set up ‘input number’ too to see the sliders. Have you done that?

input_number:    
    gym_heater_clock_hour:
      min: 0
      max: 23
      step: 1
    gym_heater_clock_minute:
      min: 0
      max: 59
      step: 10

I find it much easier to split up the config into different sections.

@ashscott so, now everything appears to be alrigt, but the timer deosn’t count down the time.

Did you get this fixed?

@ashscott No, I just can’t figure out why it doesn’t start counting the time