I finally got it working, it was much more simple than I thought, I think this is basic for MQTT users, but for begginers like me it was not obvious. Maybe this should be written in your prerequierements :
Don’t use GUI MQTT configuration, configure MQTT in yaml file to put the discovery variable to true :
This is what was missing for me for this to work :
discovery: true discovery_prefix: homeassistant
Now I have another issue with the auto discover script. Even with the retain label on, sensors are getting unavailable in HA. I tried to create the sensor manually in the configuration.yaml and I don’t have this issue (left sensors auto discovered with your script, right manual with configuration.yaml) :
Do I understand correctly that the graph for the sensor is drawn but the state is unvailable? ShellyH&T connects to the network only from time to time and that is why most of the time is unavailable.
hi there
i am getting this:
1555708733: |-- url=http://127.0.0.1:8080/superuser
1555708733: |-- data=username=homeassistant&password=&topic=&acc=-1&clientid=
1555708733: |-- aclcheck(homeassistant, homeassistant/sensor/shellyswitch25-745583-power-0/config, 2) SUPERUSER=Y by http
1555708733: |-- Cached [8FAF1EE9FECD4A4AE9EAA481207B0D021749FE3E] for (client id not available,homeassistant,2)
1555708733: |-- mosquitto_auth_acl_check(…, client id not available, homeassistant, homeassistant/sensor/shellyswitch25-73C369-energy-0/config, MOSQ_ACL_WRITE)
1555708733: |-- url=http://127.0.0.1:8080/superuser
1555708733: |-- data=username=homeassistant&password=&topic=&acc=-1&clientid=
1555708733: |-- aclcheck(homeassistant, homeassistant/sensor/shellyswitch25-73C369-energy-0/config, 2) SUPERUSER=Y by http
1555708733: |-- Cached [B6770B6E81BFBF31613F1CA6C951D8C6E2039D39] for (client id not available,homeassistant,2)
1555708733: |-- mosquitto_auth_acl_check(…, client id not available, homeassistant, homeassistant/sensor/shellyswitch25-745583-energy-0/config, MOSQ_ACL_WRITE)
1555708733: |-- url=http://127.0.0.1:8080/superuser
1555708733: |-- data=username=homeassistant&password=&topic=&acc=-1&clientid=
1555708733: |-- aclcheck(homeassistant, homeassistant/sensor/shellyswitch25-745583-energy-0/config, 2) SUPERUSER=Y by http
1555708733: |-- Cached [A698EDED0429C0B4B3681C064AAEA5E257D8FE69] for (client id not available,homeassistant,2)
1555708733: |-- mosquitto_auth_acl_check(…, client id not available, homeassistant, homeassistant/sensor/shellyswitch25-73C369-temperature-0/config, MOSQ_ACL_WRITE)
1555708733: |-- url=http://127.0.0.1:8080/superuser
1555708733: |-- data=username=homeassistant&password=&topic=&acc=-1&clientid=
1555708733: |-- aclcheck(homeassistant, homeassistant/sensor/shellyswitch25-73C369-temperature-0/config, 2) SUPERUSER=Y by http
1555708733: |-- Cached [68ECFB06E0C96B4E1D08D4EC707E5C409815158E] for (client id not available,homeassistant,2)
1555708733: |-- mosquitto_auth_acl_check(…, client id not available, homeassistant, homeassistant/switch/shellyswitch25-73C369-relay-1/config, MOSQ_ACL_WRITE)Preformatted text
There is currently no informatoion about Shelly 1PM on the Shelly API website. If you send me information about the topics that it sends to the MQTT broker I will try to add it to the script.