Polling devices

Are you stuck at a particular point, can't find the answer elsewhere, here's the place to ask.
danimal1228
Posts: 5
Joined: Sun Jan 18, 2015 11:23 pm

Polling devices

Postby danimal1228 » Mon Jan 19, 2015 12:02 am

Perhaps I missed this somewhere but is there any way to monitor zwave/zigbee/etc devices via the Wink? For example, how does one utilize the zwave smoke alarms? If one were to be triggered how does one utilize the Wink to run a script/do something?

winker
Posts: 7
Joined: Fri Jan 16, 2015 5:14 pm

Re: Polling devices

Postby winker » Mon Jan 19, 2015 10:46 am

danimal1228 wrote:Perhaps I missed this somewhere but is there any way to monitor zwave/zigbee/etc devices via the Wink? For example, how does one utilize the zwave smoke alarms? If one were to be triggered how does one utilize the Wink to run a script/do something?


I'm looking for the same thing. I see people using curl to turn output devices on/off/dim. That's great. But the other half of what's needed is to get status updates from input devices (like reed switches used in tripper, or smoke alarms, and light bulb status).

If someone could figure out some scripting examples to do "aprontest -mX -l", and show us how to run this script on the Wink hub and parse the output, and then do an IF statement on the part of the output that tells you if a door switch shows open or close - the rest could be up to us. We can run whatever ReST command tells our home automation system that the door is opened.

Wish I knew more scripting. Hoping someone will make this.

CloneNum3
Site Admin
Posts: 107
Joined: Wed Jan 07, 2015 10:02 am

Re: Polling devices

Postby CloneNum3 » Thu Jan 22, 2015 8:49 pm

you could watch the log file for the event you want to monitor with something like cron, though that would not be instant... There is probably a hook somewhere you can use as an instant trigger.

here is the info that spews out when I turn on a zigbee light (stuff like date/time, process pid, etc removed for easier reading.)

Code: Select all

[root@flex-dvt ~]# tail -f /tmp/messages | grep "aprond" | sed 's/^.*] //g' | more
zbListenerTask() (Zigbee|zigbee.c:2830): GOT ZB_ASYNC_DEVICE_ANNOUNCE from 0x7ce5240000065ded:9924
zbListenerTask() (Zigbee|zigbee.c:2838): Issuing RADIO_EVT_NODE_REJOIN for device 1
zbFireCallbacks() (Zigbee|zigbee.c:1882): Zigbee invoking generic callback...
zbFireCallbacks() (Zigbee|zigbee.c:1890): Callbacks all fired
rmZigbeeNodeRefresh() (Zigbee|zigbee.c:976): Zigbee device 1 has 12 attributes...
rmZigbeeNodeRefresh() (Zigbee|zigbee.c:980): Handling attribute with ID 19f002
zbCommandTask() (Zigbee|zigbee.c:2345): Sending read attribute command to 0x7ce5240000065ded:01:0019:0002
rmZigbeeNodeRefresh() (Zigbee|zigbee.c:980): Handling attribute with ID 2
zbCommandTask() (Zigbee|zigbee.c:2345): Sending read attribute command to 0x7ce5240000065ded:01:0008:0000
rmZigbeeNodeRefresh() (Zigbee|zigbee.c:980): Handling attribute with ID 1
zbCommandTask() (Zigbee|zigbee.c:2345): Sending read attribute command to 0x7ce5240000065ded:01:0006:0000
rmZigbeeNodeRefresh() (Zigbee|zigbee.c:980): Handling attribute with ID 4
zbCommandTask() (Zigbee|zigbee.c:2345): Sending read attribute command to 0x7ce5240000065ded:01:0004:0000
rmZigbeeNodeRefresh() (Zigbee|zigbee.c:980): Handling attribute with ID f007
zbCommandTask() (Zigbee|zigbee.c:2345): Sending read attribute command to 0x7ce5240000065ded:01:0000:0007
rmZigbeeNodeRefresh() (Zigbee|zigbee.c:980): Handling attribute with ID f006
zbCommandTask() (Zigbee|zigbee.c:2345): Sending read attribute command to 0x7ce5240000065ded:01:0000:0006
rmZigbeeNodeRefresh() (Zigbee|zigbee.c:980): Handling attribute with ID f005
zbCommandTask() (Zigbee|zigbee.c:2345): Sending read attribute command to 0x7ce5240000065ded:01:0000:0005
rmZigbeeNodeRefresh() (Zigbee|zigbee.c:980): Handling attribute with ID f004
zbCommandTask() (Zigbee|zigbee.c:2345): Sending read attribute command to 0x7ce5240000065ded:01:0000:0004
rmZigbeeNodeRefresh() (Zigbee|zigbee.c:980): Handling attribute with ID f003
zbCommandTask() (Zigbee|zigbee.c:2345): Sending read attribute command to 0x7ce5240000065ded:01:0000:0003
rmZigbeeNodeRefresh() (Zigbee|zigbee.c:980): Handling attribute with ID f002
zbCommandTask() (Zigbee|zigbee.c:2345): Sending read attribute command to 0x7ce5240000065ded:01:0000:0002
rmZigbeeNodeRefresh() (Zigbee|zigbee.c:980): Handling attribute with ID f001
zbCommandTask() (Zigbee|zigbee.c:2345): Sending read attribute command to 0x7ce5240000065ded:01:0000:0001
rmZigbeeNodeRefresh() (Zigbee|zigbee.c:980): Handling attribute with ID f000
zbCommandTask() (Zigbee|zigbee.c:2345): Sending read attribute command to 0x7ce5240000065ded:01:0000:0000
zbCommandTask() (Zigbee|zigbee.c:2373): Reconfiguring 0x7ce5240000065ded:01
zbCommandTask() (Zigbee|zigbee.c:2396): Binding input cluster 0x0000
zbCommandTask() (Zigbee|zigbee.c:2396): Binding input cluster 0x0000
zbCommandTask() (Zigbee|zigbee.c:2396): Binding input cluster 0x0000
zbCommandTask() (Zigbee|zigbee.c:2396): Binding input cluster 0x0000
zbCommandTask() (Zigbee|zigbee.c:2396): Binding input cluster 0x0000
zbCommandTask() (Zigbee|zigbee.c:2396): Binding input cluster 0x0000
zbCommandTask() (Zigbee|zigbee.c:2396): Binding input cluster 0x0000
zbCommandTask() (Zigbee|zigbee.c:2396): Binding input cluster 0x0000
zbCommandTask() (Zigbee|zigbee.c:2396): Binding input cluster 0x0004
zbCommandTask() (Zigbee|zigbee.c:2396): Binding input cluster 0x0006
zbCommandTask() (Zigbee|zigbee.c:2396): Binding input cluster 0x0008
zbCommandTask() (Zigbee|zigbee.c:2396): Binding input cluster 0x0019
zbListenerTask() (Zigbee|zigbee.c:3175): Got async attribute report!
zbListenerTask() (Zigbee|zigbee.c:3180): NetAddr: 0x9924; Source: 0x7ce5240000065ded:1; Cluster 0x0006; Attribute ID: 0x0000; State 1
zbListenerTask() (Zigbee|zigbee.c:3203): Device attribute changed to 1
zbFireCallbacks() (Zigbee|zigbee.c:1882): Zigbee invoking generic callback...
zbFireCallbacks() (Zigbee|zigbee.c:1890): Callbacks all fired
zbCommandTask() (Zigbee|zigbee.c:2358): End of batch for 0x7ce5240000065ded:01
zbListenerTask() (Zigbee|zigbee.c:3175): Got async attribute report!

Middyeasy
Posts: 17
Joined: Fri Jan 23, 2015 3:56 pm

Re: Polling devices

Postby Middyeasy » Fri Jan 23, 2015 4:14 pm

So I am FAR from being a linux expert but i do know a bit of mssq, so in poking around in the files a bit; i see they use sqlite for the db.. In doing a tiny bit of research i see sqlite does have a trigger functions and one function in particular Data Change Callback notifications..

Perhaps as simple as this????
http://programmers.stackexchange.com/qu ... tion-event

So perhaps it would be possible to create a database trigger specifically for devices that are expected to primary notify rather than simply do, and then call a callback function that simply calls a script running that calls a rule. For instance on zwave motion sensor trip, the wink would see it and then update the database status causing the trigger to run whatever.

So I'd like to start a discussion by having peoples feedback on HOW they think the wink works.

1) Can someone tell me where and which database file the aprontest -l is polling from?
2) What is the program used to view Sqllite databases?
3) what exactly does everyone expect the notification to do once we do find a way to catch it? ( personally id love to have it send an http bind to OpenHab so rules can be built. Forget using WInk Hub as anything but a wifi enabled radio relay. there is a terrific post where someone combines openhab with wink hub.


To get the ball rolling:
I know from a post i read that the Wink uses serial TTY to each of its radios.. another options might be to use a linux serial line sniffer to see what it sees and trace the changes to the database.
http://linux.die.net/man/1/slsnif

I havent yet had a chance to see if it even has slsnif though.

CloneNum3
Site Admin
Posts: 107
Joined: Wed Jan 07, 2015 10:02 am

Re: Polling devices

Postby CloneNum3 » Fri Jan 23, 2015 8:19 pm

Middyeasy wrote:So I'd like to start a discussion by having peoples feedback on HOW they think the wink works.

1) Can someone tell me where and which database file the aprontest -l is polling from?
2) What is the program used to view Sqllite databases?
3) what exactly does everyone expect the notification to do once we do find a way to catch it? ( personally id love to have it send an http bind to OpenHab so rules can be built. Forget using WInk Hub as anything but a wifi enabled radio relay. there is a terrific post where someone combines openhab with wink hub.


To get the ball rolling:
I know from a post i read that the Wink uses serial TTY to each of its radios.. another options might be to use a linux serial line sniffer to see what it sees and trace the changes to the database.
http://linux.die.net/man/1/slsnif


Per your suggestion, I have created a new forum off the main page.


Return to “Help me, I can't do xyz”

Who is online

Users browsing this forum: No registered users and 1 guest