Shelly TRV

Posted on
Tue Aug 22, 2023 9:06 am
siclark offline
Posts: 1963
Joined: Jun 13, 2017
Location: UK

Re: Shelly TRV

Thanks.. that would be great. And yes, a bit hard to test when its middle of summer!

Posted on
Thu Sep 07, 2023 4:01 am
siclark offline
Posts: 1963
Joined: Jun 13, 2017
Location: UK

Re: Shelly TRV

siclark wrote:
Cheers. Will DM you.

Hi Karl.. did you get my DM?

Posted on
Thu Sep 07, 2023 5:05 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Shelly TRV

Could you send again?


Sent from my iPhone using Tapatalk

Posted on
Thu Sep 07, 2023 5:19 am
siclark offline
Posts: 1963
Joined: Jun 13, 2017
Location: UK

Re: Shelly TRV

sent

Posted on
Tue Sep 19, 2023 4:10 pm
siclark offline
Posts: 1963
Joined: Jun 13, 2017
Location: UK

Re: Shelly TRV

I am back testing again with the new TRVs that I am slowly testing and setting up. Not helped by the latest Shelly iOS app being really buggy.. tAhnkfully the webpage for the devices is still good.

Its been a bit complicated with 3 different TRVs all needing to call for heat from the same valve (controlled by a mains thermostat that I manually set to 28c when any one needs heat, and 12 when not). The Spirit TRV plugin handled that automatically, but I got there with a number of triggers and a variable.

Now over writing the temperature read by the TRV with that from another temp sensor. Ideally this would be in the plugin, but its a simple trigger but I cant figure out how to to run the action. I just need to call "http://192.168.0.221/ext_t?temp=18". but cant see an easy way within an action. And using the below code works from the edit screen, but then errors when run when triggered.

Code: Select all
import requests
url = 'http://192.168.0.221/ext_t?temp='+str(indigo.devices[69570206]. displayStateValRaw)
data = '''{
}'''
response = requests.post(url, data=data)


Not MQTT related, but solution of use to other Shelly TRV users.

Posted on
Tue Sep 19, 2023 4:36 pm
siclark offline
Posts: 1963
Joined: Jun 13, 2017
Location: UK

Re: Shelly TRV

Turns out simplifying to this works. Although open to neater suggestions.

Code: Select all
 import requests
url = 'http://192.168.0.222/ext_t?temp='+str(indigo.devices[69570206]. displayStateValRaw)
response = requests.post(url)


I am running as Embedded Python. Assume this is ok as very quick to run?

Posted on
Tue Sep 19, 2023 4:45 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Shelly TRV

as long as it is finished within 10 secs

and you could try:
Code: Select all
url = 'http://192.168.0.222/ext_t?temp={}'.format(indigo.devices[69570206]. displayStateValRaw)
a little more python like

Posted on
Tue Sep 19, 2023 4:53 pm
siclark offline
Posts: 1963
Joined: Jun 13, 2017
Location: UK

Re: Shelly TRV

Thanks.

Yes, dont see why it wouldnt be finished in that time.

Posted on
Tue Sep 19, 2023 4:56 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Shelly TRV

Yes that’s right. But as I understand it the embedded script will not allow any other process to continue. So a one second execution there can cause some other plugins to be delayed.
You might want to execute an external script. Try curl that should be easy
Karl


Sent from my iPhone using Tapatalk

Posted on
Tue Sep 19, 2023 4:58 pm
siclark offline
Posts: 1963
Joined: Jun 13, 2017
Location: UK

Re: Shelly TRV

Good point. And the reason for moving to Shelly TRVs was to eliminate blocking of other actions yes I will move this to an external script.

Posted on
Wed Sep 20, 2023 8:50 am
jay (support) offline
Site Admin
User avatar
Posts: 18225
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Shelly TRV

siclark wrote:
Turns out simplifying to this works. Although open to neater suggestions.

Code: Select all
 import requests
url = 'http://192.168.0.222/ext_t?temp='+str(indigo.devices[69570206]. displayStateValRaw)
response = requests.post(url)


I am running as Embedded Python. Assume this is ok as very quick to run?


Note that all network connections have the potential for timeout failures. While they will *mostly* be fine, it's always best to specify short timeouts on network calls.

Code: Select all
requests.post(url, timeout=5)


That will cause a timeout exception to be raised if the call doesn't return in 5 seconds. The default network timeout in python is about 30 seconds, so even if you run as an external script, it's normally best to specify a short timeout and when you get a timeout exception then gracefully handle it.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Wed Sep 20, 2023 9:48 am
siclark offline
Posts: 1963
Joined: Jun 13, 2017
Location: UK

Re: Shelly TRV

Cheers Jay.

Posted on
Wed Sep 20, 2023 9:52 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: Shelly TRV

and with an external shell script with curl:

Code: Select all
/usr/local/bin/curl --connect-timeout 5 http://192.168.0.222/ext_t?temp=<yourvaluehere> &

Posted on
Mon Sep 25, 2023 2:40 pm
siclark offline
Posts: 1963
Joined: Jun 13, 2017
Location: UK

Re: Shelly TRV

aaronlionsheep wrote:
siclark wrote:
Morning. I have just tried that, although had rebooted the TRV and made setting changes and verified that this had also republished the settings but no, still not populated.

EDIT: I just realised that my MQTT connector plugin was frozen from lunchtime yesterday and so whilst the log appeared to show MQTT activity, it was only your plugin attempting to send. Nothing coming back into Indigo. A restart of that plugin and all was good, it saw the queue of messages with the settings in, processed them, and I do now see the names in the drop down.


Oh fantastic! Give it a try for a few days and let me know how it all works now that it should have most, if not all, the TRV features. I don’t have TRV’s over here, so I don’t really know what you need from them.

Thanks,
Aaron


Hi, Now I have some more installed I am setting up more Schedules, and the associated action groups in Indigo. It appears the plugin sees the schedule names broadcast in Settings and displays them after they have been updated on the Shelly device. But a short while later (possibly somewhere between 3-10 minutes) it seems to forget them, despite them still showing in the most recent Settings message in MQTT explorer.
Any ideas what might cause this?

Posted on
Mon Sep 25, 2023 3:59 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Shelly TRV


Who is online

Users browsing this forum: No registered users and 6 guests