I’m using zigbee2mqtt for quite a long time, for xiaomi temperature sensor & xiaomi wireless button. now I bought additional xiaomi aqara motion & illuminance sensor and having some problems setting this up. I mean: it works & reads values correctly [I guess] but I can’t customize it in the way I did it with temperature sensor & button.
so, in the share\zigbee2mqtt\configuration.yaml
I’ve got the following:
devices:
'0x00158d0001c2ce03':
##### this is the temperature & humidity sensor WSDCGQ01LM
friendly_name: sns_bedroom_RAW
qos: 1
retain: true
'0x00158d0001e5f6b4':
##### this is the button WXKG01LM
friendly_name: sns_clicker_RAW
qos: 1
retain: true
'0x00158d00029c0330':
##### this is the occupancy sensor with light sensor RTCGQ11LM
friendly_name: sns_downstairs_RAW
qos: 1
retain: true
occupancy_timeout: 90
as you can see I set my friendly_names
so in the further configuration I can adress the sensors/button with it, for example:
sensor:
- platform: template
sensors:
sns_bedroom_temperature:
value_template: >
{{ states.sensor.sns_bedroom_RAW_temperature.state | round(1) }}
…and so on - and it works great with all but the newest motion/occupancy sensor. it just ignores my friendly name and makes it’s own ugly [for my OCD ;)] sensor.0x00158d00029c0330_illuminance
and binary_sensor.0x00158d00029c0330_occupancy
- how can I change it? I tried to force edit the state.json
located with zigbee2mqtt configuration file, but with no luck. it comes back to it’s “ugly” state [which is understood, as it is written every change of the state I guess].
when I tried to bypass this and like in the above temperature sensor example I created additional template:
sensor:
- platform: template
sensors:
sns_downstairs_illuminance:
value_template: >
{{ states.sensor.0x00158d00029c0330_illuminance.state }}
but it fails config-check with:
Invalid config for [sensor.template]: invalid template (TemplateSyntaxError: expected token 'end of print statement', got 'x00158d00029c0330_illuminance') for dictionary value @ data['sensors']['sns_downstairs_illuminance ']['value_template']. Got '{{ states.sensor.0x00158d00029c0330_illuminance.state }}\n'. (See ?, line ?). Please check the docs at https://home-assistant.io/components/sensor.template/
both sns_downstairs_illuminance
and sns_bedroom_temperature
are configured in the same way, and still one of them fails with strange error…
can please somebody point me out to the right direction? or maybe I’m missing something and this is a no-can-do with the occupancy/illuminance sensor?