Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 99217

Make magnetic switch into sensor

$
0
0

@Fredrik13 wrote:

Hello
I have a magnetic switch from Telldus, that shows up in HA as a switch, where the states are “on” and “off”. I am going to use in to see if my garage door is open or not. It is not going to control anything. I would like it to show up as a sensor or door, and not a switch in the frontend.

I have tried to add sensor.yaml to my config folder and included that under homeassistant in my configuration.yaml and then tried to make a template sensor in sensor.yaml (I admit I have no clue what I am doing here). But I can not see the “sensor” under entities. Shouldn’t it come up as a sensor?

homeassistant:
  sensor: !include sensor.yaml
  customize: !include customize.yaml
  customize_domain: 
    light:
      assumed_state: false
    switch:
      assumed_state: false 
- platform: template
  sensors:
    garage_door_state:
      value_template: >- 
        {% if is_state('switch.garasjeport_sensor', 'on') %}
          Open
        {% else %}
          Closed
        {% endif %}
      icon_template: >-
        {% if is_state('switch.garasjeport_sensor', 'on') %}
          mdi:garage-open
        {% else %}
          mdi:garage
        {% endif %}
      friendly_name: 'Garasjeport'

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 99217

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>