Shelly integration: add input state to binary sensors

Hi, I know this is older post but wondering if you can assist me please.

From the Shelly app i can open/close the garage door, see the state of the switch and the state of the reed switch.

In HA I have your Github intergration using python with the Shellies Announce and Shellies Discovery installed.

As far as I can tell it is working.

In Intergrations I see the following:
Intergrations

With two entites:

I can put these on my Dashboard as an Entity card.
card

I can create a button card and open and close the garage door .

The problem I have is that I have no indication of the state of the reed switch so I can tell if the garage door is open or closed. We have a puppy that tries to escape and being able to see if my garage is open or not is important. I have seen other users get a sensor or binary_sensor of the reed switch state, usually with the name ending ‘_input’ .

And also I have seen extra sensors that give the switches RSSI output, usually the strength of the wifi signal in dBm. But I dont have that either.

I feel i’ve done something wrong and missing a few features of the Shelly switch.

Do you know how i get get those features enabled or where to check to see what the issue might be?

“Shelly smart home” means you’re using ShellyForHass, not Shellies Discovery.

You need to add

      sensors: 
        - switch

to your config, restart, and you’ll get a binary sensor for the reed switch.

Thanks
I already have the below sensor setup for my doorbell.

sensor:
  platform: rest
  name: Doorbell Status
  authentication: digest
  username: <user>
  password: <password>
  scan_interval: 1
  resource: http://192.168.0.XX/ISAPI/VideoIntercom/callStatus?format=json
  value_template: "{{ value_json.CallStatus.status }}"

I tried adding in your code but it barked at me:

duplicated mapping key at line 37, column -19:
    sensor: 
    ^

I am unsure how to arrange the ‘sensor’ within this configuration.

Also, should it be a ‘sensor’ or a ‘binary_sensor’?

I was assuming you were using ShellyForHass… I can’t help you with the Rest platform, sorry.

hmm I removed that intergation. It’s not visible anymore.

I do have Shelly for Hass installed though.

Can I ask where can i see it’s logs?

Sorry, I don’t know ShellyForHass. I recommend using the build-in HA integration for Shelly or Shellies Discovery if you prefer MQTT.

I do have Shellies Discovery and Mosquito MQTT installed and can see the Shellies Announce and Shellies Discovery Entitites. I did the full install from Gitghub

Where can I see those logs?

I suspect I have over installed and conflicts are running.

I suppose that ShellyForHass log strings will be in HA log but you have to set debug for custom_components/shelly

I’ve decided to start afresh on my Shelly1 Switch and remove all Shelly related intergrations.

Then went with built in HA intergation for Shelly, turned off MQTT on the switch itself, and now my ‘input’ is there and i can see it’s State ‘on’ or ‘off’ according to the reed switch state. Can also control the switch itself. Thanks for recomendation.

Hello,
sorry to re up that thread, but I try to do what you did with a shelly 1, a garage door, and home assistant, but I cannot get the “sensor” to work, even in the shelly app: it does’nt display the state of the garage door. (open or close)
Could you please detail the wiring and the settings of your shelly ? ( button type, other relevant options …)
Thank you very much !

Edit: im an idiot

Not using a sensor hanging off the Shelly1. Its just there as a switch not a sensor.

I’m using a seperate Aqara door and windows sensor to detect if the garage door is ‘closed’ or ‘not closed’. I did have the Shelly1 sensor teling me if door was ‘fully open’ or not ‘fully open’. As i have small dogs i need to know if fully closed or not.

Another Aqara sensor on the side gate controls whether the Shelly1 can be triggered or not. If gate is open the Shelly cannot be triggered to open the garage door. (stops dogs running away)

For the Shely setup itself I basically followed this: Smart Garage Door Opener | Shelly 1 & Home Assistant - YouTube

Important that the button type is set as ‘Detached Switch’ so the switch is separated from the relays.

yaml for HA dashboard switch:

cover:
  - platform: template
    covers:
      garage_door:
        device_class: garage
        friendly_name: "Garage Button"
        value_template: >-
          {% if is_state('binary_sensor.lumi_lumi_sensor_magnet_aq2_xxxxxxx_on_off','on') %}
            Open
          {% else %}
            Closed
          {% endif %}
        availability_template: "{{ is_state('binary_sensor.lumi_lumi_sensor_xxxxxxx_aq2_on_off','off') }}"
        open_cover:
          service: switch.turn_on
          data:
            entity_id: switch.garage_door
        close_cover:
          service: switch.turn_off
          data:
            entity_id: switch.garage_door
        stop_cover:
          service: switch.turn_on
          data:
            entity_id: switch.garage_door
        icon_template: >-
          {% if is_state('binary_sensor.lumi_lumi_sensor_magnet_aq2_xxxxxx_on_off','on') %}
            mdi:garage-open
          {% else %}
            mdi:garage
          {% endif %}

Card for garge door status

show_name: true
show_icon: true
type: button
tap_action:
  action: toggle
entity: binary_sensor.lumi_lumi_sensor_magnet_aq2_xxxxxx_on_off
name: Garage Door
show_state: true

card for garage door button

type: entities
entities:
  - entity: cover.garage_door
state_color: true

were you able to make it work? I can’t make shelly 1 get the magnetic sensor state not matter what I do…