Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Turn switch off after X minuts based on input_number value

$
0
0

@Phill_Healey wrote:

I have a switch that I want to turn off after a given number of minutes. The number of minutes is set by an input slider. However it’s not switching off after the selected time.

Any ideas as to what I’m doing wrong?

automations.yaml

- alias: Niu Manual Charge
  initial_state: true
  trigger:
    platform: state
    entity_id: switch.41034600cc50e3d1cbd7
    to: 'on'
    for:
      minutes: "{{ states('input_number.niu_battery_manual') }}"
  condition:
    - condition: state
      entity_id: input_select.niu_charge_type
      state: 'Manual'
  action:
    service: switch.turn_off
    data:
      entity_id: switch.41034600cc50e3d1cbd7

configuration.yaml:

input_number:
  niu_battery_manual:
    name: Battery Manual Time
    min: 1
    max: 7
    step: 1
    icon: 'mdi:battery-unknown'

input_select:
  niu_charge_type:
    name: Niu Charging
    icon: 'mdi:ev-station'
    options:
      - Manual
      - Bike

Posts: 6

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>