Hi,
i think its just a simple thing.
HA automation should increment a Number in the ESPHome.
There i have a Number component in ESPHome.
But the HA Service increment number seems not to be working with this.
In HA i see the slider and can move them and ESP does what it should.
Just the increment service does not work.
Any Idea how i can solve this?
esphome:
name: "heizstab"
esp8266:
board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
encryption:
key: "/f4KHXm/QS+bFrcMF95CzDRNUZ0L2pAoEeqCro+/N98="
ota:
password: "4bd0552cfef24b09b9ed5a40e6e9d71c"
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
ap:
ssid: "Esphome-Web-C87579"
password: "MmiDij94ideN"
captive_portal:
switch:
- platform: gpio
pin: 16
name: "Speicherladepumpe (80W)"
icon: "mdi:pump"
- platform: gpio
pin: 12
name: "Heizstab 1 (3200W)"
icon: "mdi:heating-coil"
id: "HS1"
- platform: gpio
pin: 14
name: "Heizstab 2 (3550W)"
icon: "mdi:heating-coil"
id: "HS2"
- platform: gpio
pin: 13
name: "Heizstab 3 (3600W)"
icon: "mdi:heating-coil"
id: "HS3"
number:
- platform: template
name: "Powerlevel"
optimistic: True
min_value: 0
max_value: 7
step: 1
id: pl
on_value:
then:
- if:
condition:
lambda: 'return id(pl).state == 0;'
then:
- switch.turn_off: HS1
- switch.turn_off: HS2
- switch.turn_off: HS3
- if:
condition:
lambda: 'return id(pl).state == 1;'
then:
- switch.turn_on: HS1
- switch.turn_off: HS2
- switch.turn_off: HS3
- if:
condition:
lambda: 'return id(pl).state == 2;'
then:
- switch.turn_off: HS1
- switch.turn_on: HS2
- switch.turn_off: HS3
- if:
condition:
lambda: 'return id(pl).state == 3;'
then:
- switch.turn_off: HS1
- switch.turn_off: HS2
- switch.turn_on: HS3
- if:
condition:
lambda: 'return id(pl).state == 4;'
then:
- switch.turn_on: HS1
- switch.turn_on: HS2
- switch.turn_off: HS3
- if:
condition:
lambda: 'return id(pl).state == 5;'
then:
- switch.turn_on: HS1
- switch.turn_off: HS2
- switch.turn_on: HS3
- if:
condition:
lambda: 'return id(pl).state == 6;'
then:
- switch.turn_off: HS1
- switch.turn_on: HS2
- switch.turn_on: HS3
- if:
condition:
lambda: 'return id(pl).state == 7;'
then:
- switch.turn_on: HS1
- switch.turn_on: HS2
- switch.turn_on: HS3
Automation in HA:
alias: Heizstab
description: ""
trigger:
- platform: numeric_state
entity_id: sensor.wirkleistung_netz_sml
for:
hours: 0
minutes: 0
seconds: 3
below: -3300
id: genug-strom-3300
- platform: numeric_state
entity_id: sensor.wirkleistung_netz_sml
above: 0
id: kein-strom
for:
hours: 0
minutes: 0
seconds: 1
- platform: numeric_state
entity_id: sensor.wirkleistung_netz_sml
for:
hours: 0
minutes: 0
seconds: 3
below: -300
id: genug-strom-300
- platform: numeric_state
entity_id: sensor.wirkleistung_netz_sml
for:
hours: 0
minutes: 0
seconds: 3
below: -100
id: genug-strom-100
condition:
- condition: numeric_state
entity_id: sensor.warmwasser_ist
below: 80
action:
- choose:
- conditions:
- condition: and
conditions:
- condition: trigger
id: genug-strom-3300
- condition: numeric_state
entity_id: number.powerlevel
above: -1
below: 1
sequence:
- service: input_number.increment
data: {}
target:
entity_id:
- number.powerlevel
- conditions:
- condition: and
conditions:
- condition: trigger
id: genug-strom-300
- condition: numeric_state
entity_id: number.powerlevel
above: 0
below: 2
sequence:
- service: input_number.increment
data: {}
target:
entity_id:
- number.powerlevel
- conditions:
- condition: and
conditions:
- condition: trigger
id: genug-strom-100
- condition: numeric_state
entity_id: number.powerlevel
above: 1
below: 3
sequence:
- service: input_number.increment
data: {}
target:
entity_id:
- number.powerlevel
- conditions:
- condition: and
conditions:
- condition: trigger
id: genug-strom-3300
- condition: numeric_state
entity_id: number.powerlevel
above: 2
below: 4
sequence:
- service: input_number.increment
data: {}
target:
entity_id:
- number.powerlevel
- conditions:
- condition: and
conditions:
- condition: trigger
id: genug-strom-100
- condition: numeric_state
entity_id: number.powerlevel
above: 3
below: 5
sequence:
- service: input_number.increment
data: {}
target:
entity_id:
- number.powerlevel
- conditions:
- condition: and
conditions:
- condition: trigger
id: genug-strom-300
- condition: numeric_state
entity_id: number.powerlevel
above: 4
below: 6
sequence:
- service: input_number.increment
data: {}
target:
entity_id:
- number.powerlevel
- conditions:
- condition: trigger
id: kein-strom
sequence:
- service: input_number.decrement
data: {}
target:
entity_id:
- number.powerlevel
mode: single