J3n50m4t / Home-Assistant-DreamScreen-Service

Home Assistant Service for sending commands to a Wifi enabled DreamScreen
MIT License
31 stars 15 forks source link

Sensors for current "mode" and current "source" #29

Open XRyu opened 4 years ago

XRyu commented 4 years ago

Hey Gregory, i would love to see an integration of a sensor exposed to HA, which gives current State of the source and mode. Bonus would be a sensor with the name of the current source as in the DS-App but thats only cosmetics for me :)

zanix commented 4 years ago

If you need a sensor now, you could make a custom sensor template

sensor:
  - platform: template
    sensors:
      dreamscreen_living_room_mode:
        friendly_name: Dreamscreen
        value_template: >-
          {% if is_state_attr('dreamscreen.living_room', 'device_mode', 1) %}
            Video
          {% elif is_state_attr('dreamscreen.living_room', 'device_mode', 2) %}
            Music
          {% elif is_state_attr('dreamscreen.living_room', 'device_mode', 3) %}
            Ambient
          {% else %}
            Off
          {% endif %}
        icon_template: >
          {% if is_state_attr('dreamscreen.living_room', 'device_mode', 1) %}
            mdi:television
          {% elif is_state_attr('dreamscreen.living_room', 'device_mode', 2) %}
            mdi:music-note
          {% elif is_state_attr('dreamscreen.living_room', 'device_mode', 3) %}
            mdi:lightbulb-on
          {% else %}
            mdi:power-off
          {% endif %}
XRyu commented 4 years ago

Oh great! This helped a lot. As i didnt know there are any state attributes :D With this everything i wanted to do was possible :)

J3n50m4t commented 4 years ago

Will keep this Open. I like the idea.

Sent with GitHawk