Hello Everyone,
I just bought two Tuya ZY-M100-S.
And I’m trying to automate the light in my bathroom.
I wanted to turn it on only if the lux was below 25, and the time is between 06:30 and 22:00.
Otherwise the led has to be turned on.
With my old PIR sensor it has worked, and now with the additional LX it doesn’t work anymore.
I think that it’s how Home Assistant displays LX (at the moment there are 1250lx , but it’s shown as 1,250).
Is there a way to remove the comma?
Here how it’s shown in Home Assistant:
And here it’s how it is shown in Zigbee2Mqtt:
The Automation is following:
alias: Illuminazione_Bagno
description: ""
trigger:
- type: present
platform: device
device_id: 7ed3e228a768fe31cf61b5ad024cd633
entity_id: 84a223fd896a65b707612a6a4349a89a
domain: binary_sensor
- type: not_present
platform: device
device_id: 7ed3e228a768fe31cf61b5ad024cd633
entity_id: 84a223fd896a65b707612a6a4349a89a
domain: binary_sensor
for:
hours: 0
minutes: 0
seconds: 30
condition: []
action:
- if:
- type: is_present
condition: device
device_id: 7ed3e228a768fe31cf61b5ad024cd633
entity_id: 84a223fd896a65b707612a6a4349a89a
domain: binary_sensor
- condition: and
conditions:
- type: is_illuminance
condition: device
device_id: 7ed3e228a768fe31cf61b5ad024cd633
entity_id: fb55b6401fcb2de89af15cfd6fe1f328
domain: sensor
below: 25
- condition: and
conditions:
- condition: time
before: "22:00:00"
after: "06:30:00"
enabled: true
then:
- parallel:
- service: switch.turn_on
metadata: {}
data: {}
target:
device_id: eb7bf39da2de79749f13c93e10972a1a
enabled: true
else:
- if:
- type: is_not_present
condition: device
device_id: 7ed3e228a768fe31cf61b5ad024cd633
entity_id: 84a223fd896a65b707612a6a4349a89a
domain: binary_sensor
- condition: and
conditions:
- condition: device
type: is_on
device_id: eb7bf39da2de79749f13c93e10972a1a
entity_id: 033ac8a695c50983561913b48f59a1ee
domain: switch
then:
- parallel:
- service: switch.turn_off
metadata: {}
data: {}
target:
device_id: eb7bf39da2de79749f13c93e10972a1a
- if:
- type: is_present
condition: device
device_id: 7ed3e228a768fe31cf61b5ad024cd633
entity_id: 84a223fd896a65b707612a6a4349a89a
domain: binary_sensor
- condition: time
after: "22:00:00"
before: "06:30:00"
then:
- parallel:
- service: light.turn_on
metadata: {}
data:
rgb_color:
- 0
- 196
- 196
brightness_pct: 65
effect: breathe
transition: 15
target:
device_id: b5957a76de9fc3650dc2d495b470b6af
enabled: true
else:
- if:
- type: is_not_present
condition: device
device_id: 7ed3e228a768fe31cf61b5ad024cd633
entity_id: 84a223fd896a65b707612a6a4349a89a
domain: binary_sensor
- condition: and
conditions:
- condition: device
type: is_on
device_id: eb7bf39da2de79749f13c93e10972a1a
entity_id: 033ac8a695c50983561913b48f59a1ee
domain: switch
then:
- parallel:
- service: switch.turn_off
metadata: {}
data: {}
target:
device_id: eb7bf39da2de79749f13c93e10972a1a
- if:
- type: is_not_present
condition: device
device_id: 7ed3e228a768fe31cf61b5ad024cd633
entity_id: 84a223fd896a65b707612a6a4349a89a
domain: binary_sensor
- condition: and
conditions:
- condition: device
type: is_on
device_id: b5957a76de9fc3650dc2d495b470b6af
entity_id: ab51b862191fa1d13f8c6f2951d99ac6
domain: light
then:
- parallel:
- service: light.turn_off
metadata: {}
data:
transition: 15
target:
device_id: b5957a76de9fc3650dc2d495b470b6af
mode: single