rzulian / lutron_custom_component

Lutron custom component for HA using pylutron
2 stars 5 forks source link

led state #3

Closed wiwan-wijoyo closed 2 years ago

wiwan-wijoyo commented 3 years ago

how to create led states? can you show me an example?

rzulian commented 3 years ago

leds are created as lights, so you can simply check the state the name is light.keypadled

you can switch on/off a led

` switches: door: friendly_name: "door" turn_on:

currently, I'm creating a led only if the associated button is controlled via automation https://github.com/rzulian/lutron_custom_component/blob/1aee01d4a7366dc50a21c5f352ea9d7a16be9984/__init__.py#L102

Do you have a different use case?

wiwan-wijoyo commented 3 years ago

light (led keypad) not appear in entities, only scene appear.

Name Entity ID Integration Living Room keypad 19: Btn 6 scene.living_room_keypad_19_btn_6 Scene

rzulian commented 3 years ago

you probably don't have integrations associated with the buttons in the Lutron project. you can try to modify the line 102 with: if not(led is None): this will create a led for every button. I could make this an option in the configuration

wiwan-wijoyo commented 3 years ago

line 102 I modify remove the (led is None) :" if not button.led_logic==5:" now can works well. the light (led keypad) appear in entity. thanks alot...

how to query state led keypad? for example if press button manual keypad then light.keypadled status on. now no effect if press manual keypad.

lutron command test with terminal telnet. ID keypad : 19 ID led button 1 : 86 query status command: ?DEVICE,19,86,9 result : ~DEVICE,19,86,9,0 = led status keypad button 1 off ~DEVICE,19,86,9,1 = led status keypad button 1 on