kslb
(KSLBe)
January 10, 2022, 9:48pm
1430
I have problem that Shelly Valve is not discovered by the script… probably not problem in the script but somewhere in configuration…
Can you please share me mqtt sensor configuration for shelly valve (TRV) so that I try to configure in old fashion way…
Thank you…
kslb
(KSLBe)
January 10, 2022, 11:02pm
1431
I mean to add mqtt sensors manually as I am used to do with Tasmota…
panhans
(Panhans)
January 11, 2022, 9:36am
1432
I get the same error. Just installed the script and the two default automations like discribed in the docs.
And I have another issue with hacs. I am able to update using HACS but when open the automations tab I even cant find the discovery script and it is not even listed.
Maybe anyone knows this issue. Is there away to force hacs clearing cache and scan for installed components again? The python_script integration is enabled for a long time in my configuration.
Bieniu
(Maciek)
January 11, 2022, 9:23pm
1433
panhans:
I get the same error.
Please post a debug log for python_script component.
Bieniu
(Maciek)
January 11, 2022, 9:26pm
1434
Which sensor?
If you want I can help with Shellies Discovery, post here a debug log for python_script component.
panhans
(Panhans)
January 12, 2022, 7:08am
1435
I set this in the configuration-file:
logger:
default: warning
logs:
homeassistant.components.python_script: debug
After restart, I here is the log. I get an info message and this:
2022-01-12 08:06:30 ERROR (SyncWorker_5) [homeassistant.components.python_script.shellies_discovery.py] Error executing script: host value None is not valid, update shellies_discovery automation
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 222, in execute
exec(compiled.code, restricted_globals)
File "shellies_discovery.py", line 1207, in <module>
ValueError: host value None is not valid, update shellies_discovery automation
Discovery automation
- id: 'shellies_discovery'
alias: 'Shellies Discovery'
mode: queued
max: 999
trigger:
platform: mqtt
topic: shellies/announce
action:
service: python_script.shellies_discovery
data:
id: '{{ trigger.payload_json.id }}'
mac: '{{ trigger.payload_json.mac }}'
fw_ver: '{{ trigger.payload_json.fw_ver }}'
model: '{{ trigger.payload_json.model }}'
mode: '{{ trigger.payload_json.mode | default }}'
host: '{{ trigger.payload_json.ip }}'
kslb
(KSLBe)
January 12, 2022, 7:56am
1436
So, I renew python script (re-download it from HACS).
I set:
logger:
default: fatal
logs:
homeassistant.components.python_script: debug
homeassistant.components.automation: info
I also set mqtt discovery and prefix:
broker: 192.168.XX.XX
port: 1883
username: XXXX
password: XXXX
discovery: true
discovery_prefix: homeassistant
I also renew discovery script and announce in automation…
- id: '010'
alias: 'Shellies Announce'
trigger:
- platform: homeassistant
event: start
- platform: time_pattern
hours: "/1" # Modifying this if you are using Shelly Motion can drain your device's battery quickly.
action:
service: mqtt.publish
data:
topic: shellies/command
payload: announce
mode: single
- id: '011'
alias: 'Shellies Discovery'
mode: queued
max: 999
trigger:
platform: mqtt
topic: shellies/announce
action:
service: python_script.shellies_discovery
data:
id: '{{ trigger.payload_json.id }}'
mac: '{{ trigger.payload_json.mac }}'
fw_ver: '{{ trigger.payload_json.fw_ver }}'
model: '{{ trigger.payload_json.model }}'
mode: '{{ trigger.payload_json.mode | default }}'
host: '{{ trigger.payload_json.ip }}'
mode: single
In MQTT HA finds new “already” added device… so discovery is working… but I do not get Shelly Valve (I have 6 devices), every valve has name shellytrv-DIFFERENT_NAME…
So, I’m a little lost…
Which logs do you need to find what is happening… Because in “home-assistant.log” I do not get any info of valve…
kslb
(KSLBe)
January 12, 2022, 11:12am
1437
Also… script do detect shelly rgbw2… so it’s working… it seems that something is wrong regarding valve detection…
kslb
(KSLBe)
January 12, 2022, 5:46pm
1440
2022-01-12 18:00:00 WARNING (MainThread) [homeassistant.components.automation.shellies_discovery] Shellies Discovery: Already running
2022-01-12 18:00:00 WARNING (MainThread) [homeassistant.components.automation.shellies_discovery] Shellies Discovery: Already running
2022-01-12 18:00:00 INFO (SyncWorker_0) [homeassistant.components.python_script] Executing shellies_discovery.py: {'id': 'shellyrgbw2-hodnik', 'mac': 'XXXXXXXX', 'fw_ver': '20211109-130054/v1.11.7-g682a0db', 'model': 'SHRGBW2', 'mode': 'color', 'host': '192.168.XXX.XXX', 'discovery_prefix': 'homeassistant', 'qos': 2}
2022-01-12 18:00:00 DEBUG (SyncWorker_0) [homeassistant.components.python_script.shellies_discovery.py] id: shellyrgbw2-hodnik, mac: XXXXXXXX, fw_ver: 20211109-130054/v1.11.7-g682a0db, model: SHRGBW2
2022-01-12 18:00:00 DEBUG (SyncWorker_0) [homeassistant.components.python_script.shellies_discovery.py] {'topic': 'homeassistant/button/shellyrgbw2-hodnik-update_firmware/config', 'payload': '{"name": "Shelly RGBW2 hodnik Update Firmware", "cmd_t": "~command", "payload_press": "update_fw", "en": "true", "uniq_id": "shellyrgbw2-hodnik-update_firmware", "qos": 2, "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "dev": {"cns": [["mac", "XXXXXXXX"]], "name": "Shelly RGBW2 hodnik", "mdl": "Shelly RGBW2", "sw": "20211109-130054/v1.11.7-g682a0db", "mf": "Allterco Robotics", "cu": "http://192.168.XXX.XXX/"}, "~": "shellies/shellyrgbw2-hodnik/", "entity_category": "config", "dev_cla": "update"}', 'retain': True, 'qos': 0}
This?
No single line regarding Shelly TRV (valve)…
PS. I reduced sensitive inf. with XXX
Don’t know how this will help you?
- id: shellies_announce
alias: Shellies Announce
trigger:
- platform: homeassistant
event: start
- platform: time_pattern
hours: /3
action:
- service: mqtt.publish
data:
topic: shellies/command
payload: announce
mode: single
- id: shellies_discovery
alias: Shellies Discovery
mode: queued
max: 999
trigger:
platform: mqtt
topic: shellies/announce
action:
service: python_script.shellies_discovery
data:
id: '{{ trigger.payload_json.id }}'
mac: '{{ trigger.payload_json.mac }}'
fw_ver: '{{ trigger.payload_json.fw_ver }}'
model: '{{ trigger.payload_json.model }}'
mode: '{{ trigger.payload_json.mode | default }}'
host: '{{ trigger.payload_json.ip }}'
qos: 0
shellyplug-s-DBED15:
relay-0: switch
force_update_sensors: true
shellyplug-s-9A34D0:
relay-0: switch
force_update_sensors: true
shellyplug-s-9A3DA7:
relay-0: switch
force_update_sensors: true
shellyplug-s-B52B86:
relay-0: switch
force_update_sensors: true
shellyswitch25-E0980695937D:
roller-0-name: ROL_LIVING_TUIN
roller-0-class: shutter
shellyswitch25-40F5202A441B:
roller-0-name: ROL_LIVING_ZIJKANT
roller-0-class: shutter
shellyswitch25-40F520002101:
roller-0-name: ROL_LIVING_STRAAT
roller-0-class: shutter
shellyswitch25-40F5202A9946:
roller-0-name: ROL_KEUKEN
roller-0-class: shutter
shellyswitch25-40F5202A9639:
roller-0-name: ROL_ACHTERDEUR
roller-0-class: shutter
shellyswitch25-40F520018AD2:
roller-0-name: ROL_BADKAMER
roller-0-class: shutter
shelly1-40F5200110A5:
relay-0: switch
relay-0-name: L_TUIN
shelly1-40F520003F14:
relay-0: switch
relay-0-name: L_INKOM
shelly1-40F5200045E7:
relay-0: switch
relay-0-name: L_OVERLOOP
shelly1-F4CFA2E5EA4B:
relay-0: switch
relay-0-name: L_WC_GLV
shellyswitch25-40F5202A97A2:
relay-0: switch
relay-0-name: L_LIVING_TAFEL1
relay-1: switch
relay-1-name: L_LIVING_TAFEL2
shellyswitch25-40F5202A44B4:
relay-0: switch
relay-0-name: L_BERGING
relay-1: switch
relay-1-name: L_KEUKEN
shellyswitch25-3C6105E55F21:
relay-0: switch
relay-0-name: L_TUIN1
relay-1: switch
relay-1-name: L_TUIN2
shelly1-40F52000E397:
relay-0: switch
relay-0-name: BWM_1_INKOM
shelly1-40F520000EFE:
relay-0: switch
relay-0-name: BWM_2_KEUKEN
shelly1-40F5200103D3:
relay-0: switch
relay-0-name: BWM_3_BERGING
shelly1-F4CFA2ECE8FD:
relay-0: switch
relay-0-name: BWM_4_OVERLOOP
shelly1-F4CFA2E5E63B:
relay-0: switch
relay-0-name: BRANDDET_BERGING
shelly1-E8DB84D23A8D:
relay-0: switch
relay-0-name: BRANDDET_OVERLOOP
shelly1-40F520008262:
relay-0: switch
relay-0-name: SIRENE
shelly1-F4CFA2ECE900:
relay-0: switch
relay-0-name: CV-KETEL
shellydimmer2-F4CFA2E1041B:
light-0-name: L_LIVING_ZETEL
shellydimmer2-40F520014879:
light-0-name: L_SLPK1
shellymotionsensor-60A423992EAC:
force_update_sensors: true
shellymotionsensor-60A42399345E:
force_update_sensors: true
shellyht-956332:
powered: ac
shellyht-955170:
powered: ac
shellyht-AC4EBD:
powered: ac
shellyswitch25-40F5202A2CFB:
relay-0: switch
relay-0-name: BP_S1
relay-1: switch
relay-1-name: BP_S2
shellyix3-8CAAB542EB07:
relay-0-name: BP_B1
relay-1-name: BP_B2
relay-2-name: BP_B3
shellybutton1-A4CF12F44C5C:
powered: ac
shellyem-B043BE:
force_update_sensors: true
shelly1pm-40F52000C59B:
force_update_sensors: true
panhans
(Panhans)
January 12, 2022, 7:14pm
1442
Posted it. There aren’t many log entries or am I missing something?
2022-01-12 20:10:27 INFO (SyncWorker_0) [homeassistant.components.python_script] Executing shellies_discovery.py: {'id': 'wohnzimmer_deckenlicht', 'mac': 'XXXXXXXXXXXX', 'fw_ver': '20211109-124958/v1.11.7-g682a0db', 'model': 'SHSW-1'}
2022-01-12 20:10:27 ERROR (SyncWorker_0) [homeassistant.components.python_script.shellies_discovery.py] Error executing script: host value None is not valid, update shellies_discovery automation
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 222, in execute
exec(compiled.code, restricted_globals)
File "shellies_discovery.py", line 1207, in <module>
ValueError: host value None is not valid, update shellies_discovery automation
log output:
2022-01-10 17:34:18 ERROR (SyncWorker_1) [homeassistant.components.python_script.shellies_discovery.py] Error executing script: expire_after value None is not an integer, check script configuration
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/python_script/__init__.py", line 222, in execute
exec(compiled.code, restricted_globals)
File "shellies_discovery.py", line 2660, in <module>
TypeError: expire_after value None is not an integer, check script configuration
Bieniu
(Maciek)
January 12, 2022, 9:47pm
1444
Bieniu
(Maciek)
January 12, 2022, 9:52pm
1445
Now I know that the script is working. Check your MQTT broker with MQTT-Explorer. Do you see there topics from TRV?
Bieniu
(Maciek)
January 12, 2022, 9:53pm
1446
This is not a log, this is a small part of the log.
kslb
(KSLBe)
January 12, 2022, 10:59pm
1447
I checked again and nothing regarding trv in shellies in MQTT explorer… so don’t know what’s the real problem… other shellies do normal popup in logs… a little frustrating…
panhans
(Panhans)
January 13, 2022, 7:45am
1448
Yes, I’ve read it and this is exact the automation I use: Shellies Discovery Script - #1435 by panhans
Before I posted here I’ve checked the latest docs and refreshed the two automations.
2022-01-12 20:10:27 INFO (SyncWorker_0) [homeassistant.components.python_script] Executing shellies_discovery.py: {'id': 'wohnzimmer_deckenlicht', 'mac': 'XXXXXXXXXXXX', 'fw_ver': '20211109-124958/v1.11.7-g682a0db', 'model': 'SHSW-1'}
As you can see in the info log entry no host is given in the json data. Maybe thats why the script generates that error.
kslb
(KSLBe)
January 13, 2022, 7:46am
1449
So, I’m stuck…
It seems as that TRV do not send any MQTT notification…
Maybe should I try somehow to direct communicate to TRV (name: shellytrv-kuhinja)…
Is that possible… Maybe to make sensors manually…