daily pastebin goal
22%
SHARE
TWEET

hasp_desk_00_components.yaml

a guest Dec 28th, 2018 74 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #hasp_desk_00_components.yaml
  2.  
  3. ##############################################################################
  4. # The devices created below are essential to the page control automations
  5. # and you'll probably want to carry them over to your own configuration
  6. homeassistant:
  7. #  customize:
  8. #    input_number.hasp_desk_alarmcode1:
  9. #      hidden: true
  10. #    input_number.hasp_desk_alarmcode2:
  11. #      hidden: true
  12. #    input_number.hasp_desk_alarmcode3:
  13. #      hidden: true
  14. #    input_number.hasp_desk_alarmcode4:
  15. #      hidden: true
  16.  
  17. # Enable this iframe to integrate the HASP web admin panel in Hass.
  18. # This will not work if you have SSL enabled, see details here:
  19. # https://www.home-assistant.io/components/panel_iframe/
  20. #
  21. #panel_iframe:
  22. #  desk:
  23. #    title: "desk"
  24. #    url: "http://desk"
  25. #    icon: "mdi:cellphone-text"
  26.  
  27. light:
  28.   - platform: mqtt
  29.     name: desk Backlight
  30.     command_topic: "hasp/desk/light/switch"
  31.     state_topic: "hasp/desk/light/state"
  32.     brightness_state_topic: "hasp/desk/brightness/state"
  33.     brightness_command_topic: "hasp/desk/brightness/set"
  34.     availability_topic: "hasp/desk/status"
  35.     payload_available: "ON"
  36.     payload_not_available: "OFF"
  37.     retrain: true
  38.  
  39. binary_sensor:
  40.   - platform: mqtt
  41.     name: desk Connected
  42.     device_class: connectivity
  43.     state_topic: "hasp/desk/status"
  44.     payload_on: "ON"
  45.     payload_off: "OFF"
  46.     availability_topic: "hasp/desk/status"
  47.     payload_available: "ON"
  48.     payload_not_available: "OFF"
  49.  
  50. sensor:
  51.   - platform: mqtt
  52.     name: desk Sensor
  53.     state_topic: "hasp/desk/sensor"
  54.     value_template: '{{ value_json.status }}'
  55.     json_attributes:
  56.      - espVersion
  57.       - updateESPAvailable
  58.       - lcdVersion
  59.       - updateLcdAvailable
  60.       - espUptime
  61.       - signalStrength
  62.       - haspIP
  63.  
  64. input_text:
  65.   hasp_desk_pagebutton1label:
  66.     name: desk Page 1 Label
  67.     icon: mdi:book-open-page-variant
  68.   hasp_desk_pagebutton2label:
  69.     name: desk Page 2 Label
  70.     icon: mdi:book-open-page-variant
  71.   hasp_desk_pagebutton3label:
  72.     name: desk Page 3 Label
  73.     icon: mdi:book-open-page-variant
  74.  
  75. input_number:
  76.   hasp_desk_pagebutton1page:
  77.     name: desk Page 1 Page
  78.     icon: mdi:format-list-numbers
  79.     min: 0
  80.     max: 9
  81.     step: 1
  82.   hasp_desk_pagebutton2page:
  83.     name: desk Page 2 Page
  84.     icon: mdi:format-list-numbers
  85.     min: 0
  86.     max: 9
  87.     step: 1
  88.   hasp_desk_pagebutton3page:
  89.     name: desk Page 3 Page
  90.     icon: mdi:format-list-numbers
  91.     min: 0
  92.     max: 9
  93.     step: 1
  94.   hasp_desk_activepage:
  95.     name: desk Active Page
  96.     icon: mdi:format-list-numbers
  97.     min: 0
  98.     max: 9
  99.     step: 1
  100. #  hasp_desk_alarmcode1:
  101. #    name: desk AlarmCode1
  102. #    icon: mdi:format-list-numbers
  103. #    min: -1
  104. #    max: 9
  105. #    step: 1
  106. #    initial: -1
  107. #  hasp_desk_alarmcode2:
  108. #    name: desk AlarmCode2
  109. #    icon: mdi:format-list-numbers
  110. #    min: -1
  111. #    max: 9
  112. #    step: 1
  113. #    initial: -1
  114. #  hasp_desk_alarmcode3:
  115. #    name: desk AlarmCode3
  116. #    icon: mdi:format-list-numbers
  117. #    min: -1
  118. #    max: 9
  119. #    step: 1
  120. #    initial: -1
  121. #  hasp_desk_alarmcode4:
  122. #    name: desk AlarmCode4
  123. #    icon: mdi:format-list-numbers
  124. #    min: -1
  125. #    max: 9
  126. #    step: 1
  127. #    initial: -1
  128. input_select:                                                         #added input_select to change displayed groups
  129.   hasp_select:
  130.     name: Select HASP
  131.     initial: desk
  132.     icon: mdi:light-switch
  133.     options:
  134.      - desk                                                           #add an option for every HASP
  135.       - office
  136.  
  137. group:
  138.   desk:
  139.     name: HASP
  140.     view: yes
  141.     icon: mdi:light-switch
  142.     entities:
  143.      - group.hasp_control
  144.       - binary_sensor.desk_connected
  145.       - sensor.desk_sensor
  146.       - group.desk_pageselect
  147.       - group.desk_colors
  148.       - group.desk_automations
  149.       - binary_sensor.office_connected                                 #groups to display from other HASPs
  150.       - sensor.office_sensor
  151.       - group.office_pageselect
  152.       - group.office_colors
  153.       - group.office_automations
  154.   hasp_control:
  155.     name: HASP Control
  156.     view: no
  157.     control: hidden
  158.     entities:
  159.      - input_select.hasp_select
  160.       - light.desk_backlight
  161.       - light.office_backlight
  162.   desk_pageselect:
  163.     name: desk Page Selection
  164.     view: no
  165.     entities:
  166.      - input_number.hasp_desk_activepage
  167.       - input_number.hasp_desk_pagebutton1page
  168.       - input_text.hasp_desk_pagebutton1label
  169.       - input_number.hasp_desk_pagebutton2page
  170.       - input_text.hasp_desk_pagebutton2label
  171.       - input_number.hasp_desk_pagebutton3page
  172.       - input_text.hasp_desk_pagebutton3label
  173.   desk_automations:
  174.     name: desk automations
  175.     view: no
  176.     entities:
  177.      - automation.hasp_desk_00_firsttimesetup
  178.  
  179. automation:
  180. ##############################################################################
  181. # Run first time setup commands
  182.   - alias: hasp_desk_00_FirstTimeSetup
  183.     trigger: []
  184.     action:
  185.       - service: automation.trigger
  186.         data:
  187.           entity_id: 'automation.hasp_desk_00_automationgroupupdate'
  188.       - service: homeassistant.turn_on
  189.         data:
  190.           entity_id: 'group.desk_automations'
  191.       - service: input_text.set_value
  192.         data:
  193.           entity_id: 'input_text.hasp_desk_pagebutton1label'
  194.           value: 'scenes'
  195.       - service: input_text.set_value
  196.         data:
  197.           entity_id: 'input_text.hasp_desk_pagebutton2label'
  198.           value: 'status'
  199.       - service: input_text.set_value
  200.         data:
  201.           entity_id: 'input_text.hasp_desk_pagebutton3label'
  202.           value: 'lights'
  203.       - service: input_number.set_value
  204.         data:
  205.           entity_id: 'input_number.hasp_desk_pagebutton1page'
  206.           value: 1
  207.       - service: input_number.set_value
  208.         data:
  209.           entity_id: 'input_number.hasp_desk_pagebutton2page'
  210.           value: 2
  211.       - service: input_number.set_value
  212.         data:
  213.           entity_id: 'input_number.hasp_desk_pagebutton3page'
  214.           value: 3
  215.       - service: input_number.set_value
  216.         data:
  217.           entity_id: 'input_number.hasp_desk_activepage'
  218.           value: 1
  219.       - service: input_number.set_value
  220.         data:
  221.           entity_id: 'input_number.hasp_desk_selectedforegroundcolor'
  222.           value: 0
  223.       - service: input_number.set_value
  224.         data:
  225.           entity_id: 'input_number.hasp_desk_selectedbackgroundcolor'
  226.           value: 65535
  227.       - service: input_number.set_value
  228.         data:
  229.           entity_id: 'input_number.hasp_desk_unselectedforegroundcolor'
  230.           value: 65535
  231.       - service: input_number.set_value
  232.         data:
  233.           entity_id: 'input_number.hasp_desk_unselectedbackgroundcolor'
  234.           value: 25388
  235.  
  236. ##############################################################################
  237. # Set automation group members on start - Thanks @Nightcat!
  238.   - alias: hasp_desk_00_AutomationGroupUpdate
  239.     trigger:
  240.     - platform: homeassistant
  241.       event: start
  242.     action:
  243.     - service: group.set
  244.       data_template:
  245.         object_id: "desk_automations"
  246.         entities: >-
  247.           {%- for item in states.automation if ((item.entity_id | lower).startswith('automation.hasp_desk_')) -%}
  248.           {{ item.entity_id }}
  249.           {% if not loop.last %}, {% endif %}
  250.           {%- endfor -%}
  251. ##############################################################################
  252. # Set automation for group visability
  253.   - alias: hasp_desk_visible
  254.     hide_entity: true
  255.     trigger:
  256.       - platform: state
  257.         entity_id: input_select.hasp_select
  258.         to: desk
  259.     action:
  260.       - service: group.set_visibility
  261.         entity_id: group.desk_pageselect
  262.         data:
  263.           visible: True
  264.       - service: group.set_visibility
  265.         entity_id: group.desk_colors
  266.         data:
  267.           visible: True
  268.       - service: group.set_visibility
  269.         entity_id: group.desk_backlight
  270.         data:
  271.           visible: True
  272.       - service: group.set_visibility
  273.         entity_id: group.desk_automations
  274.         data:
  275.           visible: True
  276.       - service: group.set_visibility
  277.         entity_id: group.office_pageselect
  278.         data:
  279.           visible: False
  280.       - service: group.set_visibility
  281.         entity_id: group.office_colors
  282.         data:
  283.           visible: False
  284.       - service: group.set_visibility
  285.         entity_id: group.office_backlight
  286.         data:
  287.           visible: False
  288.       - service: group.set_visibility
  289.         entity_id: group.office_automations
  290.         data:
  291.           visible: False
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top