Config doesn't work in customize but works on automation

Hello everyone
I have zigbee light switch, but when I turn them on with Home Assistant without specifying the intensity, I don’t get the light intensity back (but if I turn on the light with the physical switch, I get it).

To get the intensity of the light, I can call a service : zigate.read_attribute

If I make an automation to call this service when I turn the switch from off to on, it works :

- id: '1580207708972'
  alias: test
  description: test
  trigger:
  - entity_id: light.zigate_00047400009a30af_1
    from: 'off'
    platform: state
    to: 'on'
  condition: []
  action:
  - data:
      attribute_id: 17
      cluster: 8
      endpoint: 1
      entity_id: zigate.00047400009a30af
    service: zigate.read_attribute

But if I try to change customize.yaml to include this :

light.zigate_00047400009a30af_1:
  icon: mdi:toilet
  turn_on:
    - service: zigate.read_attribute
      data:
        attribute_id: 17
        cluster: 8
        endpoint: 1
        entity_id: zigate.00047400009a30af

I don’t get any answer…

Can somebody tell me where is the problem ?
Thanks

You can’t change the turn_on behaviour in customize.yaml. You can find the possible customize options here.

I don’t your issue, what do you mean with “I don’t get the light intensity back”?

if I turn on the light with home assistant, the light turns on but I don’t get de percentage of the intensity of the light in the UI

I will try to see with the plugin I use with my zigate

Thanks

Then why don’t you keep your automation that reads the light intensity with the zigate.read_attribute service? With templates you can even create one automation for all your zigate lights, that triggers the zigate.read_attribute on the light that turned on.

I think that changing the behavior of the light is a “cleaner” solution then doing an automation, but it also works

I agree, but for this change I think you might need to create an issue on Github for the zigate integration so that the developer can change the underlying behaviour.

1 Like