I just bought a Zemismart Tuya curtain motor and I’m using the new Tuya v2 beta to integrate it into Home Assistant. Unfortunately the Tuya integration adds the curtain motor into Home Assistant as a cover and it’s state is persistently listed as “unknown”. The only attributes that this cover reports is the “current_position”. All I really want is for Home Assistant to report the state of these curtains as either “Open” or “Closed”. I’m thinking that I should be able to use the current_position attribute to create some sort of template or an entirely new cover or so that if the current_position attribute reads 100 it shows that new entity as “Open” and if it shows as 0 then the entity is shown as “Closed.” Can anyone steer me in the right direction as to how I can accomplish this?
Ugh, sorry I left out a crucial piece of information. I would like that new entity to be able to also function as a switch or another cover. I get what you did with your example, it’s just creating a sensor that shows the state of the curtains by pulling the attributes from the cover. I want to add that to a “new” device/cover so I can not only toggle the curtains but correctly report their state.