Hi everyone, i am hoping if someone could help with the esphome code.
I would like to switch between pages when i press rotary encoder button. with the current code, it is not switching between pages on my ST7735 display.
i have climate control entity imported in esphome. I would like to adjust HA climate control low and high temperature target when i turn the dial in either direction. with the code below, i can only see value changes in the display but not in HA climate entity.
any help greatly appreciated as i am planning to build standalone esp device to control my central heating low and high temperature as needed. thanks
For the button you are showing the next page and then immediately returning to previous page so it appears the page is not changing. The .show_previous can be removed, .show_next will wrap around to toggle between the 2 pages.
For the temp limits, use .publish_state() to output the new value. Your lambda logic gets the current state and adds/subtracts 0.5 okay. Basically that value then needs passed inside the .publish_state() function.
Thank you for taking time and replying to it.
The screen is now switching between pages. thank you for the advice
However, climate target temp high and low are not changing in HA. I can see on the display it is changing correctly. Issue was that i like to change it on the HA climate entity when i press button, reduce target low temperature when rotary encoder is turned anticlockwise and increase target temperature when move clockwise in HA. will it be something like
homeassistant service instead of using publish.state option? I i tried code shared in last reply and - homeassistant.service & service: climate.set_temperature but unable to make it work.
You have sensors with the upstair and downstairs temperature, they are read only.
You need to send the command to the climate entity.
I can see how you think but you need to use a home assistant service call from ESP-Home or you expose the turning of the ESP to HA and create an automation in HA.
Service calls here:
I’m not sure which I would choose. Doing the service calls from EAP-Home would be very slick but it will probably be harder since you want to toggle between two climate entities.
Sorry, the publish_state() isn’t going to work with the climate entity.
Using the sensor homeassistant platform seems like a good way to keep track of the current settings in HA. The climate service calls could then be setup something like this to add/subtract from current state in a short lambda block.
target: was cut and paste from HA developer tools. Putting the entity_id in the data worked okay in my tests for calls using HA. For the climate generic_thermostat, I didn’t see any attributes for target_temp_high or target_temp_low, just temperature for the target temperature. Try the clockwise / anticlockwise event with just static data instead of the lambda to see if that shows up in HA.