Advertisement
chrisdaloa

Philips Dimer switch to control dimmerable bulb

Oct 29th, 2019
310
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 2.22 KB | None | 0 0
  1. ## DIMMER SWITCH PHILIPS PER LAMPADINA HUE ##    
  2. - id: dimmer_hue_brightness_up
  3.   alias: Dimmer Hue Luminosità on
  4.   trigger:
  5.     platform: state
  6.     entity_id: sensor.0x0017880104ec3ec1_action
  7.     to: up-press
  8.   condition:
  9.   - condition: state
  10.     entity_id: light.0x0017880102fe3dfb_light
  11.     state: 'on'
  12.   action:
  13.   - service: light.turn_on
  14.     data_template:
  15.       brightness: "{% if state_attr('light.0x0017880102fe3dfb_light' , 'brightness')\
  16.        \ | int < 205 %}\n    {{state_attr('light.0x0017880102fe3dfb_light' , 'brightness')\
  17.        \ + 51}}\n  {% else %}\n     255\n{% endif %}\n"
  18.     entity_id:
  19.    - light.0x0017880102fe3dfb_light
  20.   # - delay: 0:01
  21.   # - service: notify.telegram_notification
  22.   #   data_template:
  23.   #     message: Luminosità up {{state_attr('light.0x0017880102fe3dfb_light' , 'brightness')}}
  24.   #     title: Dimmer Philips
  25.  
  26.  
  27. - id: dimmer_hue_brightness_down
  28.   alias: Dimmer Hue Luminosità down
  29.   trigger:
  30.   - entity_id: sensor.0x0017880104ec3ec1_action
  31.     platform: state
  32.     to: down-press
  33.   condition:
  34.   - condition: state
  35.     entity_id: light.0x0017880102fe3dfb_light
  36.     state: 'on'
  37.   action:
  38.   - data_template:
  39.       brightness: "{% if state_attr('light.0x0017880102fe3dfb_light' , 'brightness')\
  40.        \ | int > 62 %}\n    {{state_attr('light.0x0017880102fe3dfb_light' , 'brightness')\
  41.        \ - 51}}\n  {% else %}\n     10\n{% endif %}\n"
  42.     entity_id:
  43.    - light.0x0017880102fe3dfb_light  
  44.     service: light.turn_on
  45.   # - delay: 0:01
  46.   # - data_template:
  47.   #     message: Luminosità down {{state_attr('light.0x0017880102fe3dfb_light' , 'brightness')}}
  48.   #     title: Dimmer Philips
  49.   #   service: notify.telegram_notification
  50.  
  51.  
  52. - id: dimmer_hue_on
  53.   alias: Dimmer Hue ON
  54.   trigger:
  55.     platform: state
  56.     entity_id: sensor.0x0017880104ec3ec1_action
  57.     to: on-press
  58.   action:
  59.   - service: light.turn_on
  60.     entity_id:
  61.    - light.0x0017880102fe3dfb_light
  62.  
  63.  
  64. - id: dimmer_hue_off
  65.   alias: Dimmer Hue OFF
  66.   trigger:
  67.     platform: state
  68.     entity_id: sensor.0x0017880104ec3ec1_action
  69.     to: off-press
  70.   action:
  71.   - service: light.turn_off
  72.     entity_id:
  73.    - light.0x0017880102fe3dfb_light
  74.  
  75. ##-- FINE DIMMER SWITCH PHILIPS PER LAMPADINA HUE --##
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement