Garage Sensor

So I recently go my garage hooked up.

  • I was wondering why the garage icons doesn’t undertatnd the state when I reboot HA. So if I have the garage open and reboot both the up and down arrows are black. Only when I first open with HA does it move to a greyed out state.

Also I’m having issues with using it as a sensor to describe the state underneath. It just says closed all of the time. When I open it never changes to open. I have attached everything involved if someone can help? Thanks!!

   cover:
      - platform: mqtt
        name: "Sonoff SV 01"
        state_topic: "cmnd/2/POWER2"
        command_topic: "cmnd/sonoffsv01/POWER"
        payload_open: "ON"
        payload_close: "ON"
        payload_stop: "ON"
        state_open: "ON"
        state_closed: "OFF"
        optomistic: false
        retain: false

 automation:
    - id: '1532560468238'
      alias: Garage Door
      trigger:
      - payload: 'ON'
        platform: mqtt
        topic: cmnd/sonoffsv01/POWER
      condition: []
      action:
      - delay: 00:00:02
      - data:
          payload: 'OFF'
          topic: cmnd/sonoffsv01/POWER
        service: mqtt.publish

   sensor:
      - platform: template
        sensors:
          garage_door_state:
            value_template: >- 
              {% if is_state('switch.sonoff_sv_01', 'true') %}
                Open
              {% else %}
                Closed
              {% endif %}
            icon_template: >-
              {% if is_state('switch.sonoff_sv_01', 'true') %}
                mdi:garage-open
              {% else %}
                mdi:garage
              {% endif %}
            friendly_name: 'Garage Door'

switch:
   - platform: mqtt
     name: "Sonoff SV 01"
     state_topic: "stat/sonoffsv01/POWER"
     command_topic: "cmnd/sonoffsv01/power"
     qos: 1
     payload_on: "ON"
     payload_off: "OFF"
     retain: true

Could you format your code using the </> button in the editor please? It makes it easier to see whether there are obvious syntax/indentation issues
image

Sure thing. Just edited up there. Hope I did it right. Kinda confusing how it works.

Try setting retain to true. Also payload_close looks like it should be “OFF”.

Also, I haven’t updated Tasmota in a while but my state topics are “stat/XXX/POWER”, not “cmnd/XXX/POWER”. Optimistic is also misspelled.:grinning: