Now, my Dingz Dimmer and LED Configuration has a state, I can share it with you.
Suggestions for improvement are welcome.
rest_commands
dingz_generic_dimmer:
url: http://{{ ip }}/api/v1/dimmer/{{ dimmer }}/{{ enum }}
method: POST
payload: 'value={{ value }}'
content_type: 'application/x-www-form-urlencoded; charset=utf-8'
dingz_generic_led_onoff:
url: http://{{ ip }}/api/v1/led/set
method: POST
payload: 'action={{ action }}'
content_type: 'application/x-www-form-urlencoded; charset=utf-8'
dingz_generic_led:
url: http://{{ ip }}/api/v1/led/set
method: POST
payload: 'action={{ action }}&color={{ colh }};{{ cols }};{{ colv }}&mode=hsv'
content_type: 'application/x-www-form-urlencoded; charset=utf-8'
scripts
dingz_led_level_generic_onoff:
alias: Dingz LED Level Generic onoff
sequence:
- service: rest_command.dingz_generic_led_onoff
data:
action: '{{ action }}'
ip: '{{ ip }}'
- service: homeassistant.update_entity
target:
entity_id: '{{ force_entity }}'
mode: single
icon: hass:lightbulb
dingz_led_level_generic:
alias: Dingz LED Level Generic
sequence:
- service: rest_command.dingz_generic_led
data:
action: '{{ action }}'
colh: '{{ colh }}'
cols: '{{ cols }}'
colv: '{{ colv }}'
ip: '{{ ip }}'
- service: homeassistant.update_entity
target:
entity_id: '{{ force_entity }}'
mode: single
icon: hass:lightbulb
dingz_light_level_generic:
alias: Dingz Light Level Generic
sequence:
- service: rest_command.dingz_generic_dimmer
data:
dimmer: '{{ dimmer }}'
enum: '{{ enum }}'
value: '{{ brightness }}'
ip: '{{ ip }}'
- service: homeassistant.update_entity
target:
entity_id: '{{ force_entity }}'
mode: single
icon: hass:lightbulb
light template
# ####### Dingz Dusche Decke Light
dingz_dusche_decke_light:
unique_id: dingz_dusche_decke_light
friendly_name: "Dingz Dusche Decke"
level_template: "{{ (state_attr('sensor.dingz_dusche_state', 'dimmers')[2]['output']*255/100)|int }}"
value_template: "{{ state_attr('sensor.dingz_dusche_state', 'dimmers')[2]['on']}}"
turn_on:
service: script.dingz_light_level_generic
entity_id: light.dingz_dusche_decke_light
data:
brightness: "40"
enum: "on"
dimmer: 2
ip: !secret ip_dingz_dusche
force_entity: sensor.dingz_dusche_state
turn_off:
service: script.dingz_light_level_generic
entity_id: light.dingz_dusche_decke_light
data:
brightness: "0"
enum: "off"
dimmer: 2
ip: !secret ip_dingz_dusche
force_entity: sensor.dingz_dusche_state
set_level:
service: script.dingz_light_level_generic
entity_id: light.dingz_dusche_decke_light
data:
brightness: "{{ (brightness * 100 / 255) | int }}"
enum: "on"
dimmer: 2
ip: !secret ip_dingz_dusche
force_entity: sensor.dingz_dusche_state
# ####### Dingz Markise1 LED
dingz_markise1_led:
unique_id: dingz_markise1_led
friendly_name: "Dingz Markise1 LED"
level_template: "{{ ((state_attr('sensor.dingz_markise1_state', 'led')['hsv'].split(';')[2]|int) * 255 / 100) | int }}"
value_template: "{{ state_attr('sensor.dingz_markise1_state', 'led')['on'] }}"
color_template: "({{ state_attr('sensor.dingz_markise1_state', 'led')['hsv'].split(';')[0] | int }}, {{ state_attr('sensor.dingz_markise1_state', 'led')['hsv'].split(';')[1] | int }})"
turn_on:
service: script.dingz_led_level_generic_onoff
entity_id: led.dingz_markise1_led
data:
action: "on"
ip: !secret ip_dingz_markise1
force_entity: sensor.dingz_markise1_state
turn_off:
service: script.dingz_led_level_generic_onoff
entity_id: led.dingz_markise1_led
data:
action: "off"
ip: !secret ip_dingz_markise1
force_entity: sensor.dingz_markise1_state
set_level:
service: script.dingz_led_level_generic
entity_id: led.dingz_markise1_led
data:
action: "on"
colh: "{{ state_attr('sensor.dingz_markise1_state', 'led')['hsv'].split(';')[0] | int }}"
cols: "{{ state_attr('sensor.dingz_markise1_state', 'led')['hsv'].split(';')[1] | int }}"
colv: "{{ (brightness * 100 / 255) | int }}"
ip: !secret ip_dingz_markise1
force_entity: sensor.dingz_markise1_state
set_color:
service: script.dingz_led_level_generic
entity_id: led.dingz_markise1_led
data:
action: "on"
colh: "{{ h }}"
cols: "{{ s }}"
colv: "{{ state_attr('sensor.dingz_markise1_state', 'led')['hsv'].split(';')[2] }}"
ip: !secret ip_dingz_markise1
force_entity: sensor.dingz_markise1_state
and finally, the depending sensor example, that gets information from dingz
platform: rest
method: GET
resource: !secret url_sensor_dingz_kuche
# http://ip/api/v1/state
name: Dingz Kuche State
value_template: "OK"
json_attributes:
- "dimmers"
- "blinds"
- "led"
- "sensors"
- "thermostat"
- "wifi"