Advertisement
LeehamPastesStuff

How to create Alias for input select

Jul 2nd, 2022
24
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. input_select:
  2. floodlight01_mode:
  3. name: Floodlight01
  4. options:
  5. - "Auto" # = 1
  6. - "Off" # = 0
  7. - "On" # = 2
  8. icon: mdi:target
  9.  
  10. automation:
  11. - alias: "Set Thermostat Mode Selector"
  12. trigger:
  13. platform: mqtt
  14. topic: "stat/tasmota_38088B/DPTYPE4ID101"
  15. # entity_id: input_select.floodlight01_mode
  16. action:
  17. service: input_select.select_option
  18. target:
  19. entity_id: input_select.floodlight01_mode
  20. data:
  21. option: "{{ trigger.payload }}"
  22.  
  23. # This automation script runs when the thermostat mode selector is changed.
  24. # It publishes its value to the same MQTT topic it is also subscribed to.
  25. - alias: "Set Floodlight01 Mode"
  26. trigger:
  27. platform: state
  28. entity_id: input_select.floodlight01_mode
  29. action:
  30. service: mqtt.publish
  31. data:
  32. topic: "cmnd/tasmota_38088B/TuyaSend4"
  33. retain: true
  34. payload: "101,{{ states('input_select.floodlight01_mode') }}"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement