Updated Home Assistant (markdown)

emontnemery 2018-12-08 09:27:56 +01:00
parent 68664495e1
commit a0cfb06cf9
1 changed files with 31 additions and 31 deletions

@ -363,7 +363,7 @@ sensor:
value_template: "{{ value_json.StatusPWR.Factor }}"
```
### Manually add Dimmer / PWM LED
### Manually add Dimmer / PWM LED (As done by MQTT discovery)
Configure the module, and on the Console run:
`SetOption4 1`
`SetOption15 1`
@ -391,6 +391,36 @@ light:
retain: false
```
### Manually add Dimmer / PWM LED (Custom version)
Change the brightness template entities to match your entity name.
configuration.yaml
```yaml
- platform: mqtt
name: "TuyaDimTest"
state_topic: "stat/TuyaDimTest/POWER"
command_topic: "cmnd/TuyaDimTest/POWER"
availability_topic: "tele/TuyaDimTest/LWT"
brightness_state_topic: "stat/TuyaDimTest/RESULT"
brightness_command_topic: "cmnd/TuyaDimTest/Dimmer"
brightness_scale: 100
brightness_value_template: >
{% if value_json.Dimmer is defined %}
{{ value_json.Dimmer }}
{% else %}
{% if state_attr('light.tuyadimtest','brightness') == none %}
0
{% else %}
{{ state_attr('light.tuyadimtest','brightness') / 255 * 100 }}
{% endif %}
{% endif %}
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: false
```
### Manually add RGB Lights
#### Any 3-channel PWM LED dimmer or AiLight
Configure the module, and on the Console run:
@ -794,33 +824,3 @@ Pat Ceiling Fan:
- fan.pat_ceiling_fan
- light.pat_ceiling_light
```
# Dimmer / PWM LED
Change the brightness template entities to match your entity name.
configuration.yaml
```yaml
- platform: mqtt
name: "TuyaDimTest"
state_topic: "stat/TuyaDimTest/POWER"
command_topic: "cmnd/TuyaDimTest/POWER"
availability_topic: "tele/TuyaDimTest/LWT"
brightness_state_topic: "stat/TuyaDimTest/RESULT"
brightness_command_topic: "cmnd/TuyaDimTest/Dimmer"
brightness_scale: 100
brightness_value_template: >
{% if value_json.Dimmer is defined %}
{{ value_json.Dimmer }}
{% else %}
{% if state_attr('light.tuyadimtest','brightness') == none %}
0
{% else %}
{{ state_attr('light.tuyadimtest','brightness') / 255 * 100 }}
{% endif %}
{% endif %}
qos: 1
payload_on: "ON"
payload_off: "OFF"
payload_available: "Online"
payload_not_available: "Offline"
retain: false
```