Page 1 of 1

Report event using API

Posted: Friday 27 December 2019 13:59
by ChrisVH1982
Dear community,

I got two "Shelly Flood". These should report to me by push on critical events regarding my laundry or heating. Shelly flood will not report to Domoticz using MQTT but I know of a Python Plugin that I am not going to use.
I am wondering whether or not there's a chance to use those GET comment sent by Shelly flood.

According to the Shelly web interface, it can send a http string with payload to something like e.g. Domoticz ("Report as GET parameters to HTTP url")

Can you advise what type of URL needs to be used on Shelly and what needs to be done on Domoticz to get alerted?

Re: Report event using API

Posted: Friday 27 December 2019 14:34
by waaren
ChrisVH1982 wrote: Friday 27 December 2019 13:59 According to the Shelly web interface, it can send a http string with payload to something like e.g. Domoticz ("Report as GET parameters to HTTP url")
Can you advise what type of URL needs to be used on Shelly and what needs to be done on Domoticz to get alerted?
What kind of alert do you want ? If you only need an alert device to be updated or only need to send a notification via domoticz then

Code: Select all

http://<username:password@>domoticz-ip<:port>/json.htm?type=command&param=udevice&idx=IDX&nvalue=LEVEL&svalue=TEXT
or

Code: Select all

http://<username:password@>domoticz-ip<:port>/json.htm?type=command&param=sendnotification&subject=SUBJECT&body=THEBODY
will do. But if you need a combination of those some scripting will be required.

Re: Report event using API

Posted: Friday 27 December 2019 14:53
by ChrisVH1982
Hi! Thank you so far! The second link works fine but this is not the goal since I also want to see the status in Domotic as a button of type on/off or whatsoever.

I understood that the below link will send text string "level" to a device with the IDX of my choice. Two questions on this:
1. Can I add a variable from Shelly to this or will shelly issue that command always on any event? In this case I of course would need to disable temperature updates.
2. What type of virtual button is required in Domoticz to accept that string value?

http://<username:password@>domoticz-ip<:port>/json.htm?type=command&param=udevice&idx=IDX&nvalue=LEVEL&svalue=TEXT

Re: Report event using API

Posted: Friday 27 December 2019 15:06
by waaren
ChrisVH1982 wrote: Friday 27 December 2019 14:53 Hi! Thank you so far! The second link works fine but this is not the goal since I also want to see the status in Domotic as a button of type on/off or whatsoever.

I understood that the below link will send text string "level" to a device with the IDX of my choice. Two questions on this:
1. Can I add a variable from Shelly to this or will shelly issue that command always on any event? In this case I of course would need to disable temperature updates.
2. What type of virtual button is required in Domoticz to accept that string value?

http://<username:password@>domoticz-ip<:port>/json.htm?type=command&param=udevice&idx=IDX&nvalue=LEVEL&svalue=TEXT
I cannot answer 1. because I have no idea how shelly works
2. This particular JSON is for an Alert type virtual device but you can find the JSON for all type of devices at this wiki page

Re: Report event using API

Posted: Friday 27 December 2019 15:49
by ChrisVH1982
Thank you. I will instead use a switch command to switch on a virtual switch instead. That works out fine!