Report event using API

Moderator: leecollings

Post Reply
ChrisVH1982
Posts: 23
Joined: Friday 16 November 2018 17:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Report event using API

Post 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?
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Report event using API

Post 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.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
ChrisVH1982
Posts: 23
Joined: Friday 16 November 2018 17:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Report event using API

Post 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
User avatar
waaren
Posts: 6028
Joined: Tuesday 03 January 2017 14:18
Target OS: Linux
Domoticz version: Beta
Location: Netherlands
Contact:

Re: Report event using API

Post 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
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
ChrisVH1982
Posts: 23
Joined: Friday 16 November 2018 17:59
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Report event using API

Post by ChrisVH1982 »

Thank you. I will instead use a switch command to switch on a virtual switch instead. That works out fine!
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest