Hi, I have device with 3 buttons. It’s plus/minus/enter running on ESP8266 connected to ESPhome. I’m able to read buttons, make some action. For test, I make number helper in HA and this helper is readed in ESPhome code.
My question is how can I change value of number helper when I hit the button plus. I need increment number in HA by one step, or defined step (in example bellow it’s 0,1)?
Is it possible to make it in lambda?
My part of code:
sensor:
- platform: homeassistant
id: "my_value"
entity_id: input_number.my_number
internal: False
binary_sensor:
- platform: gpio
pin: GPIO12
id: plus
on_press:
then:
lambda: |-
id(my_value) = id(my_value) + 0.1;
id(my_value).publish_state(my_value);
Thank you for reply.