Hello,
I implemented some covers as described here Rademacher.
Now I am running into trouble with my cover. The sensor is showing the correct state, also fitting to the state in the 3rd-party-system. If position is somewhere below “fully open”, the up-arrow remains grey. Also the position-slider stays at 0.
Grey arrow:
Position in zero, even if sensor on 84%:
Setting a new position via slider or arrow-down is working fine, so the communication via rest seems to be working fine.
Here’s my configuration:
Sensor:
- platform: rest
name: 'fenster_wohnzimmer_sofa_position'
resource: 'http://192.168.1.1/devices/1'
value_template: >-
{% for item in value_json.payload.device.capabilities %}
{%- if item.name == "CURR_POS_CFG" -%}
{{ 100 - float(item.value) }}
{%- endif -%}
{% endfor %}
scan_interval: 20
REST:
belt_winder_up:
url: 'http://192.168.1.1/devices/{{ did }}'
method: PUT
payload: '{"name":"POS_UP_CMD"}'
belt_winder_down:
url: 'http://192.168.1.1/devices/{{ did }}'
method: PUT
payload: '{"name":"POS_DOWN_CMD"}'
belt_winder_stop:
url: 'http://192.168.1.1/devices/{{ did }}'
method: PUT
payload: '{"name":"STOP_CMD"}'
belt_winder_set_position:
url: 'http://192.168.1.1/devices/{{ did }}'
method: PUT
payload: '{"name":"GOTO_POS_CMD","value":"{{ 100 - float(position)|int }}"}'
Cover:
- platform: template
covers:
fenster_wohnzimmer_sofa:
device_class: shutter
friendly_name: "Fenster Wohnzimmer Sofa"
position_template: "{{ states('fenster_wohnzimmer_sofa_position') }}"
open_cover:
- service: rest_command.belt_winder_up
data:
did: 1
close_cover:
- service: rest_command.belt_winder_down
data:
did: 1
stop_cover:
- service: rest_command.belt_winder_stop
data:
did: 1
set_cover_position:
- service: rest_command.belt_winder_set_position
data_template:
did: 1
position: "{{position}}"
As written above, the device also gives the correct state via rest api.
Somebody having an idea?
Kind Regards,
Markus