Open ed-holland opened 3 years ago
I have the same issue
I have Tuya TS0601 thermostats and I would also like to able to switch the child lock on and off. Maybe the best way to solve it would be to have a choice to add an lock-entity instead of an toggle/switch in the header?
It sounds like a great idea - I have the same which seems to be annoying as cannot be enabled.
@ed-holland I would not call it a bug but an enhancement to define what a toggle could do. Let's say when it's on, the specific state is set. I am not sure if this was resolved since it was raised
@nervetattoo maybe you could help?
I got this sorted now. Created both: helper (input_boolean - already mentioned in Readme) and automation to publish MQTT when it's toggled.
@Strixx76 @DenisBY @ed-holland if you are interested about automations to address the following:
- Click on Toggle to change state
- Lock entity does not change
Create input_boolean
helper and automation to publish via MQTT when it is toggled
- Use entity to lock
- Toggle does not change
Add another trigger to the above automation to update the toggle with input_boolean.turn_off
and input_boolean.turn_on
services. You just need to workout your payloads and change some naming.
Here it is:
alias: childlock_thermostat
description: ""
trigger:
- platform: state
entity_id:
- input_boolean.childlock
to: "off"
id: "1"
- platform: state
entity_id:
- input_boolean.childlock
to: "on"
id: "2"
- platform: state
entity_id:
- lock.thermostat_bedroom_child_lock
to: unlocked
id: "3"
- platform: state
entity_id:
- lock.thermostat_bedroom_child_lock
to: locked
id: "4"
condition: []
action:
- if:
- condition: trigger
id: "1"
then:
- service: mqtt.publish
data:
topic: zigbee2mqtt/Thermostat_Bedroom/set
payload: "{\"child_lock\": \"UNLOCK\"}"
qos: "0"
- if:
- condition: trigger
id: "2"
then:
- service: mqtt.publish
data:
payload: "{\"child_lock\": \"LOCK\"}"
topic: zigbee2mqtt/Thermostat_Bedroom/set
qos: "0"
- if:
- condition: trigger
id: "3"
then:
- service: input_boolean.turn_off
data: {}
target:
entity_id: input_boolean.childlock
else: []
- if:
- condition: trigger
id: "4"
then:
- service: input_boolean.turn_on
data: {}
target:
entity_id: input_boolean.childlock
else: []
mode: single
Describe the bug I'm using a header toggle with a lock entity (provided by a tuya TH213 device). The action to enable the lock, does not lock. If i lock using the lock-entity, it does not show the status
To Reproduce
Expected behavior Toggle to follow lock status
Screenshots
Browser