Hi,
I am setting up a template cover, which has a tilt and a position value (not just closed/open), then I need to do some calculations in lambda.
I know that I can use lambda in ‘tilt_action’ to get the tilt value I set in HA, but I can’t figure out how to get the position.
When I click open/close buttons in HA UI, open/close_actions get triggered, but when I set a manual position in HA, nothing is triggered, so I don’t know where to get the position value… I am missing some kindof ‘position_action’ in ESPHome… Couldn’t find anything in docs. I am on a version 1.14.3.
Sure, although it’s just a bunch of test stuff right now. I am just missing this one piece, something like a “position_action” to get a variable with requested position value from HA UI.
Please note that there are two covers (time_cover and template), I am using the time cover to control the actual motor and to use it’s timing function to estimate position, but actually the template cover is exposed to HA to add tilt functionality, and I need to get the position value from template cover to sync it with the time cover.
No, it is not unfortunately. I checked that one too.
In the base cover there is only an action to control the cover, to set the tilt and position manually, this is what I need to do with the time_based cover, but what I want is to retrieve the set position from the template cover, same as it works with tilt.
I will try to simplify the example a bit. Let’s assume you have just this simple template cover:
This will effectively expose as new cover entity in HA, where I can manually set the tilt and position.
Now when I change the tilt value on the tilt slider, the tilt_action will get triggered and the “Tilting to: xx %” will get logged to the ESP log. This now works. And I just need to do exactly the same thing for the position.
I need something like:
position_action:
- logger.log:
format: "Moving cover to: %.2f"
args: ["pos"]
But there is nothing like that…
I hope this clears my question a bit
I have upgraded my roller blinds last weekend and have installed esphome 1.5.0-dev. There is an undocumented change to ESPHome that adds the position_action: functionallity. So, if you can wait till the release of ESPHome 1.5.0 (or don’t mind installing the development branch right now), you can get this out of the box.
It’ll work like the “something you need”, but keep in mind the variable you have to use is fixed and is indeed pos
I am using the addon from addon store in Hass.io, could you please share what it takes to update to the dev branch? Is there a dev build of docker image which will work with Hass.io? Or do I have to install esphome manually and then somehow make it work with Home Assistant?
I don’t think there is a pre-build dockerfile for hassio that includes the nightly builds. I know the “regular” docker image does include the dev branches.
Just use the dev tag (esphome/esphome:dev) if you want to use that docker image.
Oh I see, I thought there is some ingress magic between HA and ESPHome plugin, but I just realized that the Native API works just through an integration directly with the device, which is using ESPHome firmware, so it doesn’t matter where and how the ESPHome “manager” itself is installed, I just might lose the nice menu entry in the HA side panel to open the ESPHome UI directly. And I would have to add it manually and point to to the right port for the ESPHome UI exposed from Docker.
Awesome… Well thank you very much @FF-Fox and @nickrout . Appreciate your help, I am glad this feature is in works. I will try to get the dev branch working.