Can that be done? My Nuki locks allow me to install a hook whereby any state change is reported in a nuki json format to any ip:port I want so every time a lock is changed, it's state change is reported.
I'd like to capture these changes in dzvents instead of in my current bash script so I need some way to get dzvents to listen for json messages on a specific port on my raspberry pi (where domoticz also runs). I struggle to understand how the asynchronous http mechanism supports that...
Any help greatly appreciated.
H
using dzvents to listen on a port
Moderator: leecollings
- heggink
- Posts: 994
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
using dzvents to listen on a port
Docker in Truenas scale, close to latest beta
RFXCOM 433 and 868, zigbee2mqtt,
P1 meter & solar panel
RFXCOM 433 and 868, zigbee2mqtt,
P1 meter & solar panel
-
elmortero
- Posts: 248
- Joined: Sunday 29 November 2015 20:46
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 3.9639
- Location: Spain
- Contact:
Re: using dzvents to listen on a port
Have a look at the dzvents manual, under the topic http response.
- heggink
- Posts: 994
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: using dzvents to listen on a port
that's what I tried but I fail to see how I can listen on a port without issuing a request first...
Docker in Truenas scale, close to latest beta
RFXCOM 433 and 868, zigbee2mqtt,
P1 meter & solar panel
RFXCOM 433 and 868, zigbee2mqtt,
P1 meter & solar panel
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: using dzvents to listen on a port
If your nuki (bridge) can send something like /json.htm?type=command¶m=updateuservariable&vname=NAME&vtype=TYPE&vvalue=VALUEheggink wrote: Friday 24 August 2018 15:47 Can that be done? My Nuki locks allow me to install a hook whereby any state change is reported in a nuki json format to any ip:port I want so every time a lock is changed, it's state change is reported.
I'd like to capture these changes in dzvents instead of in my current bash script so I need some way to get dzvents to listen for json messages on a specific port on my raspberry pi (where domoticz also runs). I struggle to understand how the asynchronous http mechanism supports that...
to domoticzIP:domoticzPORT then dzVents can be used because domoticz will then trigger an event.
As far as I understand, the current dzVents version only reacts to events triggered by domoticz.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
- Egregius
- Posts: 2592
- Joined: Thursday 09 April 2015 12:19
- Target OS: Linux
- Domoticz version: v2024.7
- Location: Beitem, BE
- Contact:
Re: using dzvents to listen on a port
That won't work if it only can send a json string. You could use a small php page to decode the json.
- Dnpwwo
- Posts: 820
- Joined: Sunday 23 March 2014 9:00
- Target OS: Raspberry Pi / ODroid
- Domoticz version: Beta
- Location: Melbourne, Australia
- Contact:
Re: using dzvents to listen on a port
You could create a python plugin that listens for JSON.
Under plugins/examples there is one called "HTTP Listener" which shows how to listen on an ip & port. If you set the connection's protocol to JSON rather than HTTP it will return JSON messages in dictionaries (and/or lists depending on the JSON) in the onMessage function when your Nuki sends a message.
EDIT: Just looked Nuki up, looks interesting. If you need help writing a plugin let me know.
Under plugins/examples there is one called "HTTP Listener" which shows how to listen on an ip & port. If you set the connection's protocol to JSON rather than HTTP it will return JSON messages in dictionaries (and/or lists depending on the JSON) in the onMessage function when your Nuki sends a message.
EDIT: Just looked Nuki up, looks interesting. If you need help writing a plugin let me know.
The reasonable man adapts himself to the world; the unreasonable one persists to adapt the world to himself. Therefore all progress depends on the unreasonable man. George Bernard Shaw
- heggink
- Posts: 994
- Joined: Tuesday 08 September 2015 21:44
- Target OS: Raspberry Pi / ODroid
- Domoticz version: 12451
- Location: NL
- Contact:
Re: using dzvents to listen on a port
Help? YES PLEASE. My python skills are really appalling (I'm just an old C programmer who knew when to quit
).
These nuki devices are really great. I have had them for quite a while. I did mod them to replace the batteries with a power adapter as they don't like being polled (drains the batteries).
I'll take a look at the python plugin and put some thoughts on paper.
Many thanks for the offer!
).These nuki devices are really great. I have had them for quite a while. I did mod them to replace the batteries with a power adapter as they don't like being polled (drains the batteries).
I'll take a look at the python plugin and put some thoughts on paper.
Many thanks for the offer!
Docker in Truenas scale, close to latest beta
RFXCOM 433 and 868, zigbee2mqtt,
P1 meter & solar panel
RFXCOM 433 and 868, zigbee2mqtt,
P1 meter & solar panel