ShellyTeacher for Domoticz

For devices supporting the Auto Discovery feature. Like ZWaveJS2MQTT, Zigbee2MQTT.

Moderator: leecollings

MikeyMan
Posts: 237
Joined: Wednesday 17 October 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ShellyTeacher for Domoticz

Post by MikeyMan »

Having issues with the plugin, so I thought I'd give this one a try. Rather user unfriendly for non programmers it seems. Too much config outside of domoticz. Hope this improves.

Also getting an error while installing:

Code: Select all

pi@raspberrypi:~/domoticz/plugins $ sudo apt install python3-pip git
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
git is already the newest version (1:2.30.2-1+deb11u2).
python3-pip is already the newest version (20.3.4-4+rpt1+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~/domoticz/plugins $ sudo pip3 install paho-mqtt --break-system-packages
Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 5, in <module>
    from pip._internal.cli.main import main
ImportError: No module named pip._internal.cli.main
Any thoughts?
lwolf
Posts: 216
Joined: Saturday 10 November 2018 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Hungary
Contact:

Re: ShellyTeacher for Domoticz

Post by lwolf »

MikeyMan wrote: Thursday 30 November 2023 2:33 Having issues with the plugin, so I thought I'd give this one a try. Rather user unfriendly for non programmers it seems. Too much config outside of domoticz. Hope this improves.
It is not a plugin. It is a helper application for simple beings who dont want to send config templates manually to integrate their Shelly devices to MQTT-AD.
There is a Windows version for non programmers. Do you see the video about usage?
MikeyMan wrote: Thursday 30 November 2023 2:33 Also getting an error while installing:

Code: Select all

pi@raspberrypi:~/domoticz/plugins $ sudo apt install python3-pip git
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
git is already the newest version (1:2.30.2-1+deb11u2).
python3-pip is already the newest version (20.3.4-4+rpt1+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~/domoticz/plugins $ sudo pip3 install paho-mqtt --break-system-packages
Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 5, in <module>
    from pip._internal.cli.main import main
ImportError: No module named pip._internal.cli.main
Of course, it is for Debian12 based systems:

Code: Select all

sudo pip3 install paho-mqtt --break-system-packages
For other systems, normal pip command will work:

Code: Select all

sudo pip3 install paho-mqtt
MikeyMan
Posts: 237
Joined: Wednesday 17 October 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ShellyTeacher for Domoticz

Post by MikeyMan »

lwolf wrote: Thursday 30 November 2023 19:48
MikeyMan wrote: Thursday 30 November 2023 2:33 Having issues with the plugin, so I thought I'd give this one a try. Rather user unfriendly for non programmers it seems. Too much config outside of domoticz. Hope this improves.
It is not a plugin. It is a helper application for simple beings who dont want to send config templates manually to integrate their Shelly devices to MQTT-AD.
For this simple being, it's still a bit too much it seems.
There is a Windows version for non programmers. Do you see the video about usage?
My domoticz install is on a pi. I was happy using the plugin, since it was working rather okay. Until recently.
MikeyMan wrote: Thursday 30 November 2023 2:33 Also getting an error while installing:

Code: Select all

pi@raspberrypi:~/domoticz/plugins $ sudo apt install python3-pip git
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
git is already the newest version (1:2.30.2-1+deb11u2).
python3-pip is already the newest version (20.3.4-4+rpt1+deb11u1).
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi:~/domoticz/plugins $ sudo pip3 install paho-mqtt --break-system-packages
Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 5, in <module>
    from pip._internal.cli.main import main
ImportError: No module named pip._internal.cli.main
Of course, it is for Debian12 based systems:

Code: Select all

sudo pip3 install paho-mqtt --break-system-packages
For other systems, normal pip command will work:

Code: Select all

sudo pip3 install paho-mqtt
This results in the same error:

Code: Select all

pi@raspberrypi:~/domoticz/plugins/shellyteacher4domo $ sudo pip3 install paho-mqtt
Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 5, in <module>
    from pip._internal.cli.main import main
ImportError: No module named pip._internal.cli.main
Could be user related for Pi.
lwolf
Posts: 216
Joined: Saturday 10 November 2018 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Hungary
Contact:

Re: ShellyTeacher for Domoticz

Post by lwolf »

MikeyMan wrote: Friday 01 December 2023 11:33
lwolf wrote: Thursday 30 November 2023 19:48 There is a Windows version for non programmers. Do you see the video about usage?
My domoticz install is on a pi. I was happy using the plugin, since it was working rather okay. Until recently.
There is no need to run the ShellyTeacher on the same device, where Domoticz installed. There is only one condition: the ShellyTeacher have to see the MQTT broker IP address and of course to access the broker port which is 1883 default.
So it can be run on on a Windows device once, and register all Shelly devices to the MQTT broker in retain mode. There is no need to run it again, until you buy a new Shelly device.
Image
MikeyMan wrote: Friday 01 December 2023 11:33 This results in the same error:

Code: Select all

ImportError: No module named pip._internal.cli.main
Could be user related for Pi.
Its not really ShellyTeacher related. Your pip3 is simply broken. Reinstall pip or let it go.
https://www.google.com/search?channel=f ... l.cli.main+
Jonkheer
Posts: 11
Joined: Wednesday 15 March 2017 10:45
Target OS: Linux
Domoticz version: 2023.2
Contact:

Re: ShellyTeacher for Domoticz

Post by Jonkheer »

lwolf wrote: Wednesday 29 November 2023 17:42 All right, waiting for the MQTT debugging data!
I can't see strange behavior...only the ammount of publications for the specific device.
I've done a factory reset and installed the device again. Everything in that process goes fine. After installing in Domoticz it's status is directly -1%.

Code: Select all

	Line 42523: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0', ... (4 bytes))
	Line 42524: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/pos', ... (2 bytes))
	Line 42525: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/pos', ... (2 bytes))
	Line 42526: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/stop_reason', ... (6 bytes))
	Line 42527: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/stop_reason', ... (6 bytes))
	Line 42528: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/power', ... (4 bytes))
	Line 42529: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/power', ... (4 bytes))
	Line 42530: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/relay/power', ... (4 bytes))
	Line 42531: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/relay/power', ... (4 bytes))
	Line 42532: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/energy', ... (3 bytes))
	Line 42533: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/energy', ... (3 bytes))
	Line 42534: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/relay/energy', ... (3 bytes))
	Line 42535: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/relay/energy', ... (3 bytes))
	Line 42536: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/input/1', ... (1 bytes))
	Line 42537: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/input/1', ... (1 bytes))
	Line 42538: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/input/0', ... (1 bytes))
	Line 42539: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/input/0', ... (1 bytes))
	Line 42540: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/temperature', ... (5 bytes))
	Line 42541: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/temperature', ... (5 bytes))
	Line 42542: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/temperature_f', ... (6 bytes))
	Line 42543: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/temperature_f', ... (6 bytes))
	Line 42544: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/overtemperature', ... (1 bytes))
	Line 42545: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/overtemperature', ... (1 bytes))
	Line 42546: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/temperature_status', ... (6 bytes))
	Line 42547: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/temperature_status', ... (6 bytes))
	Line 42548: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/voltage', ... (6 bytes))
	Line 42549: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/voltage', ... (6 bytes))
I've found out that the Shelly device has also difficulties with the callibration proces. Although the shutters work fine with the Shellt GUI. Callibartion is not possible. I think there's a link. But I don't underdstand why it does not send a command for opening or closing via Domoticz.
lwolf
Posts: 216
Joined: Saturday 10 November 2018 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Hungary
Contact:

Re: ShellyTeacher for Domoticz

Post by lwolf »

Jonkheer wrote: Friday 01 December 2023 19:45
lwolf wrote: Wednesday 29 November 2023 17:42 All right, waiting for the MQTT debugging data!
I can't see strange behavior...only the ammount of publications for the specific device.
I've done a factory reset and installed the device again. Everything in that process goes fine. After installing in Domoticz it's status is directly -1%.

Code: Select all

	Line 42523: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0', ... (4 bytes))
	Line 42524: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/pos', ... (2 bytes))
	Line 42525: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/pos', ... (2 bytes))
	Line 42526: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/stop_reason', ... (6 bytes))
	Line 42527: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/stop_reason', ... (6 bytes))
	Line 42528: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/power', ... (4 bytes))
	Line 42529: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/power', ... (4 bytes))
	Line 42530: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/relay/power', ... (4 bytes))
	Line 42531: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/relay/power', ... (4 bytes))
	Line 42532: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/energy', ... (3 bytes))
	Line 42533: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/roller/0/energy', ... (3 bytes))
	Line 42534: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/relay/energy', ... (3 bytes))
	Line 42535: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/relay/energy', ... (3 bytes))
	Line 42536: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/input/1', ... (1 bytes))
	Line 42537: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/input/1', ... (1 bytes))
	Line 42538: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/input/0', ... (1 bytes))
	Line 42539: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/input/0', ... (1 bytes))
	Line 42540: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/temperature', ... (5 bytes))
	Line 42541: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/temperature', ... (5 bytes))
	Line 42542: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/temperature_f', ... (6 bytes))
	Line 42543: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/temperature_f', ... (6 bytes))
	Line 42544: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/overtemperature', ... (1 bytes))
	Line 42545: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/overtemperature', ... (1 bytes))
	Line 42546: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/temperature_status', ... (6 bytes))
	Line 42547: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/temperature_status', ... (6 bytes))
	Line 42548: 1701454936: Received PUBLISH from shellyswitch25-C45BBE6C403E (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/voltage', ... (6 bytes))
	Line 42549: 1701454936: Sending PUBLISH to Domoticz-MQTT-AutoDiscover739c7e16-5fe2-4428-bf18-38517b6ec0b09 (d0, q0, r0, m0, 'shellies/shellyswitch25-C45BBE6C403E/voltage', ... (6 bytes))
I've found out that the Shelly device has also difficulties with the callibration proces. Although the shutters work fine with the Shellt GUI. Callibartion is not possible. I think there's a link. But I don't underdstand why it does not send a command for opening or closing via Domoticz.
Please use an MQTT client like MQTT Explorer to get MQTT data.

Show me configuration object from this MQTT path:
homeassistant/cover/shellyswitch25-C45BBE6C403E-roller-0/config

If the device is not calibrated, it wont work with the default config object, as Domoticz uses position method, if it is described in the config object. I can assemble a barely open/close capable for you if you wish - without positioning.

Your device published

Code: Select all

'shellies/shellyswitch25-C45BBE6C403E/roller/0/pos'
'shellies/shellyswitch25-C45BBE6C403E/roller/0/stop_reason'
what is the data for that?
Jonkheer
Posts: 11
Joined: Wednesday 15 March 2017 10:45
Target OS: Linux
Domoticz version: 2023.2
Contact:

Re: ShellyTeacher for Domoticz

Post by Jonkheer »

lwolf wrote: Saturday 02 December 2023 8:52 Please use an MQTT client like MQTT Explorer to get MQTT data.

Code: Select all

{
"name": "shellyswitch25-C45BBE6C403E Roller 0", 
"cmd_t": "~roller/0/command", 
"stat_t": "~roller/0", 
"pos_t": "~roller/0/pos", 
"set_pos_t": "~roller/0/command/pos", 
"avty_t": "~online", 
"pl_avail": "true", 
"pl_not_avail": "false", 
"json_attr_t": "~info", 
"pl_open": "open", 
"pl_cls": "close", 
"pl_stop": "stop", 
"stat_opening": 
"open", "stat_closing": 
"close", "pos_open": 100, 
"pos_clsd": 0, 
"uniq_id": "shellyswitch25-C45BBE6C403E-roller-0", 
"qos": 1, 
"~": "shellies/shellyswitch25-C45BBE6C403E/"
}
I think (hope) this is wat you asked for?
lwolf wrote: Saturday 02 December 2023 8:52 If the device is not calibrated, it wont work with the default config object, as Domoticz uses position method, if it is described in the config object. I can assemble a barely open/close capable for you if you wish - without positioning.
It's strange behavior from the device and I didn't noticed before. When i installed it a had it calibrated. So if you can help we with a work around...that is much appreciated!
lwolf
Posts: 216
Joined: Saturday 10 November 2018 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Hungary
Contact:

Re: ShellyTeacher for Domoticz

Post by lwolf »

Jonkheer wrote: Sunday 03 December 2023 9:50

Code: Select all

{
"name": "shellyswitch25-C45BBE6C403E Roller 0", 
"cmd_t": "~roller/0/command", 
"stat_t": "~roller/0", 
"pos_t": "~roller/0/pos", 
"set_pos_t": "~roller/0/command/pos", 
"avty_t": "~online", 
"pl_avail": "true", 
"pl_not_avail": "false", 
"json_attr_t": "~info", 
"pl_open": "open", 
"pl_cls": "close", 
"pl_stop": "stop", 
"stat_opening": 
"open", "stat_closing": 
"close", "pos_open": 100, 
"pos_clsd": 0, 
"uniq_id": "shellyswitch25-C45BBE6C403E-roller-0", 
"qos": 1, 
"~": "shellies/shellyswitch25-C45BBE6C403E/"
}
I think (hope) this is wat you asked for?
Yes, thank you. It seems that your config object is fine.
Jonkheer wrote: Sunday 03 December 2023 9:50 It's strange behavior from the device and I didn't noticed before. When i installed it a had it calibrated. So if you can help we with a work around...that is much appreciated!
According to Shelly docs:
/roller/0/pos reports the current position in percent, -1 if invalid
I think this is your current situation.

You can add the following two line into mqtt_templates.txt under "[SHSW-21-roller][SHSW-25-roller]"

Code: Select all

topic=%discovery_prefix%/cover/%shelly_id%-roller-0-basic/config
payload={"name": "%shelly_id% Roller 0 Basic", "cmd_t": "~roller/0/command", "stat_t": "~roller/0", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false", "pl_open": "open", "pl_cls": "close", "pl_stop": "stop", "state_opening": "open", "state_closing": "close", "state_stopped": "stop", "uniq_id": "%shelly_id%-roller-0-basic", "qos": 1, "~": "shellies/%shelly_id%/"}
I hope it will work, i removed every position-aware property from it. You need to teach again the non-working Shelly device, after adding this line, of course.
Jonkheer
Posts: 11
Joined: Wednesday 15 March 2017 10:45
Target OS: Linux
Domoticz version: 2023.2
Contact:

Re: ShellyTeacher for Domoticz

Post by Jonkheer »

Thanks Iwolf!,

I will add the lines to the config. But I do think there's an issue with the devive. There is still waranty on it, so I also made a ticket at Shelly.com.
I'll inform if the extra lines makes any difference.

8-)
lwolf
Posts: 216
Joined: Saturday 10 November 2018 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Hungary
Contact:

Re: ShellyTeacher for Domoticz

Post by lwolf »

Jonkheer wrote: Sunday 03 December 2023 14:00 Thanks Iwolf!,

I will add the lines to the config. But I do think there's an issue with the devive. There is still waranty on it, so I also made a ticket at Shelly.com.
I'll inform if the extra lines makes any difference.

8-)
I am testing the template, but i think it will not work, as Shelly roller do not reply if it is in fully opened or fully closed state, it can only be gathered from position topic. And if position -1 nothing will work.
Although i can add a Selector Switch (disabled by default) which can be used to control stop/close/open state and it will get the actual state from Shelly 2.5.

Code: Select all

topic=%discovery_prefix%/select/%shelly_id%/cover-control/config
payload={"name": "%shelly_id% Cover Control", "~": "shellies/%shelly_id%/", "uniq_id": "%shelly_id%-0-covercontrol", "enabled_by_default": false, "cmd_t": "~roller/0/command", "stat_t": "~roller/0", "avty_t": "~online", "pl_avail": "true", "pl_not_avail": "false","stat_cla": "selector" , "ops":["stop","close","open"] }
Cover Control selector added at today commit.
MikeyMan
Posts: 237
Joined: Wednesday 17 October 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ShellyTeacher for Domoticz

Post by MikeyMan »

So, please forgive my multitude of stupid questions... But i'm trying to ease into this, to see if it fixes some issues i have with the python plugin.

Here goes:
- What does the teacher actually do? Does it send data through to Domoticz? Or just alters the MQTT messages in the broker?
- What is the difference between AutoMQTT and using this feature?
- Can i run the old stuff and the new stuff in parallel? If so; do i need to point the MQTT devices to a new prefix?
- If i want to switch over a device from python to teacher, what are the steps?
Xavier82
Posts: 178
Joined: Tuesday 07 June 2016 22:09
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Netherlands
Contact:

Re: ShellyTeacher for Domoticz

Post by Xavier82 »

MikeyMan
Posts: 237
Joined: Wednesday 17 October 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ShellyTeacher for Domoticz

Post by MikeyMan »

Xavier82 wrote: Tuesday 05 December 2023 16:02 @MikeyMan: Check this topic:
viewtopic.php?t=25656&hilit=shellyteacher&start=500
Maybe I'm missing something. But I don't see an answer tot any of my earlier questions there.
User avatar
waltervl
Posts: 5392
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: ShellyTeacher for Domoticz

Post by waltervl »

MikeyMan wrote: Tuesday 05 December 2023 14:34 So, please forgive my multitude of stupid questions... But i'm trying to ease into this, to see if it fixes some issues i have with the python plugin.

Here goes:
- What does the teacher actually do? Does it send data through to Domoticz? Or just alters the MQTT messages in the broker?
- What is the difference between AutoMQTT and using this feature?
- Can i run the old stuff and the new stuff in parallel? If so; do i need to point the MQTT devices to a new prefix?
- If i want to switch over a device from python to teacher, what are the steps?
See https://github.com/enesbcs/shellyteacher4domo

What it does is making MQTT Auto discover config topics for your Shelly devices so that Domoticz can understand what the devices are sending over MQTT. Those MQTT config topics are retained by the MQTT broker so after a reboot of Domoticz it will reuse them.

No you cannot use plugin and teacher. It is stated in the readme.

Steps are the same as with any other switch from one environment to another. See for example Zwave-JS-UI and Zigbee2MQTT Domoticz wiki pages
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
lwolf
Posts: 216
Joined: Saturday 10 November 2018 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Hungary
Contact:

Re: ShellyTeacher for Domoticz

Post by lwolf »

MikeyMan wrote: Tuesday 05 December 2023 14:34 So, please forgive my multitude of stupid questions... But i'm trying to ease into this, to see if it fixes some issues i have with the python plugin.
It will fix python plugin issues, as its not a python plugin. Domoticz MQTT Autodiscovery hardware is written in C and is part of the Domoticz default build. This is behind the whole idea. Python plugins has a tendency to use all memory and cause Domoticz to crash.
MikeyMan wrote: Tuesday 05 December 2023 14:34 Here goes:
- What does the teacher actually do? Does it send data through to Domoticz? Or just alters the MQTT messages in the broker?
Shelly devices speak MQTT but has NO autodiscovery function by factory.
So if ShellyTeacher app founds a supported Shelly device online, it sends the correct configuration object to the MQTT broker, which is necessary for the Discovery process, without this information the MQTT-AD hardware unable to do anything.
After teaching the devices to Domoticz MQTT-AD controller do the rest, the Teacher is not necessary to operate the devices, as configuration object sent in 'retain' mode, and if the MQTT broker operates well, its saved into its database.
MikeyMan wrote: Tuesday 05 December 2023 14:34 - What is the difference between AutoMQTT and using this feature?
I do not understand your question. What is the difference between the butter and bread?
Butter needs to be spread onto bread, and ShellyTeacher sends configuration object to Domoticz MQTT Autodiscovery hardware.
MikeyMan wrote: Tuesday 05 December 2023 14:34 - Can i run the old stuff and the new stuff in parallel? If so; do i need to point the MQTT devices to a new prefix?
In fact you can run them paralell. If you disable Gen1 checkbox before ShellyTeacher teaching process, it will only find Gen2 devices, and there wont be duplications.
Otherwise, Gen1 devices will appear under the new hardware and will exists under the old hardware also, which is not a good idea.
(If you change the prefix, old ShellyMQTT plugin will not work, as it is not prepared for this - its almost the same if you just delete the ShellyMQTT plugin)
MikeyMan wrote: Tuesday 05 December 2023 14:34 - If i want to switch over a device from python to teacher, what are the steps?
I just renamed new devices to their old names. Maybe others have better ideas, somewhere i saw a topic for zigbee2mqtt which also supports Autodiscovery and that is the proposed hardware also.
Last edited by lwolf on Tuesday 05 December 2023 19:08, edited 2 times in total.
User avatar
waltervl
Posts: 5392
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: ShellyTeacher for Domoticz

Post by waltervl »

For replacing old Domoticz device by new to keep the history of old device you can use the device replace function under the edit button.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
MikeyMan
Posts: 237
Joined: Wednesday 17 October 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ShellyTeacher for Domoticz

Post by MikeyMan »

lwolf wrote: Tuesday 05 December 2023 19:01
MikeyMan wrote: Tuesday 05 December 2023 14:34 So, please forgive my multitude of stupid questions... But i'm trying to ease into this, to see if it fixes some issues i have with the python plugin.
It will fix python plugin issues, as its not a python plugin. Domoticz MQTT Autodiscovery hardware is written in C and is part of the Domoticz default build. This is behind the whole idea. Python plugins has a tendency to use all memory and cause Domoticz to crash.
Point is; that with the plugin i suddenly have an issue with a PlusHT. Was trying to check if this issue remained with the autodiscovery function

MikeyMan wrote: Tuesday 05 December 2023 14:34 Here goes:
- What does the teacher actually do? Does it send data through to Domoticz? Or just alters the MQTT messages in the broker?
Shelly devices speak MQTT but has NO autodiscovery function by factory.
So if ShellyTeacher app founds a supported Shelly device online, it sends the correct configuration object to the MQTT broker, which is necessary for the Discovery process, without this information the MQTT-AD hardware unable to do anything.
After teaching the devices to Domoticz MQTT-AD controller do the rest, the Teacher is not necessary to operate the devices, as configuration object sent in 'retain' mode, and if the MQTT broker operates well, its saved into its database.
Thanks, very enlightening.
MikeyMan wrote: Tuesday 05 December 2023 14:34 - What is the difference between AutoMQTT and using this feature?
I do not understand your question. What is the difference between the butter and bread?
Butter needs to be spread onto bread, and ShellyTeacher sends configuration object to Domoticz MQTT Autodiscovery hardware.
with the above explanation this makes sense :)
MikeyMan wrote: Tuesday 05 December 2023 14:34 - Can i run the old stuff and the new stuff in parallel? If so; do i need to point the MQTT devices to a new prefix?
In fact you can run them paralell. If you disable Gen1 checkbox before ShellyTeacher teaching process, it will only find Gen2 devices, and there wont be duplications.
Otherwise, Gen1 devices will appear under the new hardware and will exists under the old hardware also, which is not a good idea.
(If you change the prefix, old ShellyMQTT plugin will not work, as it is not prepared for this - its almost the same if you just delete the ShellyMQTT plugin)


for testing purposes, i would be okay with the double devices for now. :)
MikeyMan wrote: Tuesday 05 December 2023 14:34 - If i want to switch over a device from python to teacher, what are the steps?
I just renamed new devices to their old names. Maybe others have better ideas, somewhere i saw a topic for zigbee2mqtt which also supports Autodiscovery and that is the proposed hardware also.
I have been testing with a PlusHT. This was already in use in my MQTT server.
Restarting etc doesnt seem to make it discoverable. Tried to delete all retained topics as well, but no luck yet.
MikeyMan
Posts: 237
Joined: Wednesday 17 October 2018 12:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ShellyTeacher for Domoticz

Post by MikeyMan »

Settings seem to be okay
Schermafbeelding 2023-12-05 195823.png
Schermafbeelding 2023-12-05 195823.png (66.59 KiB) Viewed 4294 times
Schermafbeelding 2023-12-05 195910.png
Schermafbeelding 2023-12-05 195910.png (40.72 KiB) Viewed 4294 times
lwolf
Posts: 216
Joined: Saturday 10 November 2018 18:29
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Hungary
Contact:

Re: ShellyTeacher for Domoticz

Post by lwolf »

MikeyMan wrote: Tuesday 05 December 2023 19:59 Settings seem to be okay

Schermafbeelding 2023-12-05 195823.png
The default Gen2 prefix has no "shellies/" in it. ShellyTeacher subscribes to "+/online" topic where it awaits basic announcements. + is a wildcard meaning exactly one level deep with any name.

Updated ShellyTeacher 0.6 is available on github.
https://github.com/enesbcs/shellyteache ... s/tag/0.06
azeph
Posts: 4
Joined: Wednesday 20 December 2023 23:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ShellyTeacher for Domoticz

Post by azeph »

Hi, I have a Shelly Plus Plus S to measure power and energy. I use the ShellyTeacher results for Domoticz for some days now for this device. I really like ithis. I have a question: With the ShellyTeacher for Domoticz the graph of the energy shows up as an incremental line graph (see the attachment). I also have the Wi-Fi Energy Socket of HomeWizard (which is also a power meter) and for that I use the eraser3/HomeWizard-Wifi-Energy-Socket plugin to show the graphs in Domoticz. This plugin shows the power and energy as a non-incremental line graph and a column graph respectively. This I find more informative and easy to interpret (see the other attachment). Would it be possible to show the graphs from ShellyTeacher for Domoticz in the way that it is displayed with the Eraser3/HomeWizard-Wifi-Energy-Socket plugin? If that would be possible, it would be great!
Attachments
WifiEnergySocket.png
WifiEnergySocket.png (129.77 KiB) Viewed 4050 times
ShellyInDomoticz.png
ShellyInDomoticz.png (101.12 KiB) Viewed 4050 times
Post Reply

Who is online

Users browsing this forum: elzorrovega and 0 guests