I think that we should use off_delay
parameter https://www.home-assistant.io/integrations/binary_sensor.mqtt/#off_delay
Yes! I agree that would solve the issue. Do you think it would it be possible to add it as an argument in the script configuration?
Thanks for looking into this.
New version: 0.13.3
Changelog:
- add
off_delay: 3
parameter tolongpush
binary sensor - fix RGBW2 effect list
Just used this script for Shelly 2.5 and Shelly Dimmer. Thanks it seems to work well. I did run into a few issues any ideas? These may just be shelly firmware issues.
- On the Shelly 2.5 the switch inputs (binary sensor 0 and 1) are inverted (connecting to live is off). Ticking the reverse option in the switch settings does not seem to address.
- A binary senor for the inputs is not created in the MQTT server. The input itself exists (shellies/shellydimmer-F36490/input/0). I cannot see a reason to run in detached mode? Why does it have two inputs?
Script uses state on
for value 1
and state off
for value 0
for input binary_sensor. Check values for your Shellyâs topics.
There isnât information about input
topic for Dimmer on Shelly API documentation page.
New version: 0.14.0
Changelog:
- add support for Shelly Door/Window
Hi all
i have had trouble setting this up, here is what iâve done so far.
** **
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# http:
# base_url: example.duckdns.org:8123
# Text to speech
tts:
** - platform: google_translate**
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
python_script:
logger:
** logs:**
** homeassistant.components.automation: info**
# Example configuration.yaml entry
#mqtt:
# discovery: true
# discovery_prefix: homeassistant
and in automations file
python_script:
automation:
-
id: shellies_announce
alias: âShellies Announceâ
trigger:- platform: homeassistant
event: start
action:
service: mqtt.publish
data:
topic: shellies/command
payload: announce
- platform: homeassistant
-
id: âshellies_discoveryâ
alias: âShellies Discoveryâ
trigger:- platform: mqtt
topic: shellies/announce
action:
service: python_script.shellies_discovery
data_template:
id: â{{ trigger.payload_json.id }}â
mac: â{{ trigger.payload_json.mac }}â
fw_ver: â{{ trigger.payload_json.fw_ver }}â
- platform: mqtt
And logs from MQTT
[13:54:49] INFO: Setup mosquitto configuration
[13:54:49] WARNING: SSL not enabled - No valid certs found!
[13:54:49] INFO: Found local users inside config
[13:54:51] INFO: Initialize Hass.io Add-on services
[13:54:51] INFO: Initialize Home Assistant discovery
[13:54:51] INFO: Start Mosquitto daemon
1578837291: mosquitto version 1.6.3 starting
1578837291: Config loaded from /etc/mosquitto.conf.
1578837291: Loading plugin: /usr/share/mosquitto/auth-plug.so
1578837291: |-- *** auth-plug: startup
1578837291: âââ Username/password checking enabled.
1578837291: âââ TLS-PSK checking enabled.
1578837291: âââ Extended authentication not enabled.
1578837291: Opening ipv4 listen socket on port 1883.
1578837291: Opening ipv6 listen socket on port 1883.
1578837291: Opening websockets listen socket on port 1884.
1578837292: Warning: Mosquitto should not be run as root/administrator.
1578837292: New connection from 192.168.1.177 on port 1883.
[INFO] found hassio on local database
1578837295: New client connected from 192.168.1.177 as mqtt_53856c09.3aa494 (p2, c1, k60, uâhassioâ).
1578837300: New connection from 192.168.1.143 on port 1883.
1578837300: New client connected from 192.168.1.143 as DVES_6337F9 (p2, c1, k30, uâhassioâ).
1578837300: New connection from 192.168.1.55 on port 1883.
1578837300: New connection from 192.168.1.90 on port 1883.
1578837300: New connection from 192.168.1.131 on port 1883.
1578837300: New client connected from 192.168.1.55 as DVES_B1D60C (p2, c1, k30, uâhassioâ).
1578837300: New client connected from 192.168.1.90 as DVES_893B5A (p2, c1, k30, uâhassioâ).
1578837300: New client connected from 192.168.1.131 as DVES_499E2F (p2, c1, k30, uâhassioâ).
1578837305: New connection from 192.168.1.179 on port 1883.
1578837305: New client connected from 192.168.1.179 as shellyem-B9E43D (p2, c1, k60, uâhassioâ).
1578837314: New connection from 192.168.1.95 on port 1883.
1578837314: New client connected from 192.168.1.95 as mqtt_51de11c9.0cc89 (p2, c1, k60).
Hi
Shellies discovery is not available on HACS anymore and manual install doesnât seem to work after latest hassio update
sorry my mistake I forgot to enable scripts on hacs install
Thank you for making this!
First, thanks for this great script!
I noticed an issue that seems to occur with newer Shelly 2.5. My Shelly 2.5 were not getting discovered while it s working fine for the other Shelly models. The device id has become longer than it is for the other Shelly. It is now 12 digits instead of 6 (e.g. âshellyswitch25-98F4ABF2D39Câ vs. âshelly1-F42429â), which breaks the script.
I made a local change in line 184 (from âif id[:-7] == âshellyswitch25â:â to âif id[:-13] == âshellyswitch25â:â which got working for me, but may not be the cleanest solution as I suspect the device id format could also change for other Shelly devices in future.
There is no official information about change the length of the ID. This would be a breaking change for the script. You should ask Shelly support about that.
Actually I saw such information (in changelog or in discussion on FB). they extended it to full MAC address because of conflicts reported by users
Please try this version https://github.com/bieniu/ha-shellies-discovery/blob/228a7210b9fd85e7635b59a4f7182e7ad6953fef/python_scripts/shellies_discovery.py
Hi
Again thank you for the script. I works great but I have one problem regarding the cover positions on Shelly 2.5
Is it possible to get the Shelly 2.5 cover position info and position control?
I donât know. Is it possible with manual MQTT configuration?
Yes I made it with Mqtt using these lines:
-
shellies/shellyswitch-<deviceid>/roller/0/pos
reports the current position in percent -
shellies/shellyswitch-<deviceid>/roller/0/command/pos
accepts a number between 0 and 100, which is the target position in percent.
I did the calibration first
-shellies/shellyswitch-/roller/0/command/rc (performs roller calibration)