I only do sexy. :)
Thanks, I might take you up on that offer depending how things go (I'm in no rush to find a job, so looking for the "right" job).
I'm going to email you my code. I had to make changes from your sample code a bit to make it integrate with my existing code. I got it working, but I am getting some odd results. Here is a sample of what I'm talking about from my log...
12:50:30.949 -> ChipChop => {"api_call":"heartbeat","command":"heartbeat","uuid":"xxx","device_id":"000001","status":{"Notification":{"value":"Office light turned on."},"BlueLED":{"value":"OFF"},"WhiteLED":{"value":"OFF"},"LightSensor":{"value":102},"Temperature":{"value":76.44}}}
12:50:32.242 -> ChipChop => {"status":"ok","timestamp":1707483032716}
12:50:37.388 -> ChipChop => {"api_call":"heartbeat","command":"triggerevent","uuid":"xxx","device_id":"000001","status":{"Notification":{"value":"Office light turned off."}}}
12:50:38.662 -> ChipChop => {"status":"ok","timestamp":1707483038723}
12:50:41.186 -> ChipChop => {"api_call":"heartbeat","command":"heartbeat","uuid":"xxx","device_id":"000001","status":{"Notification":{"value":"Office light turned off."},"BlueLED":{"value":"OFF"},"WhiteLED":{"value":"OFF"},"LightSensor":{"value":2362},"Temperature":{"value":76.44}}}
12:50:42.499 -> ChipChop => {"status":"ok","timestamp":1707483042725}
12:50:51.427 -> ChipChop => {"api_call":"heartbeat","command":"heartbeat","uuid":"xxx","device_id":"000001","status":{"Notification":{"value":"Stop"},"BlueLED":{"value":"OFF"},"WhiteLED":{"value":"OFF"},"LightSensor":{"value":0},"Temperature":{"value":76.44}}}
12:50:51.472 -> event delay for 1 sec
12:50:52.483 -> ChipChop => Event will not be sent. Max requests speed of 500 milliseconds between events has been exceeded.
12:50:53.713 -> ChipChop => {"status":"ok","timestamp":1707483052734}
12:51:02.667 -> ChipChop => {"api_call":"heartbeat","command":"heartbeat","uuid":"xxx","device_id":"000001","status":{"Notification":{"value":"Stop"},"BlueLED":{"value":"OFF"},"WhiteLED":{"value":"OFF"},"LightSensor":{"value":2379},"Temperature":{"value":76.44}}}
12:51:03.970 -> ChipChop => {"status":"ok","timestamp":1707483063743}
12:51:12.918 -> ChipChop => {"api_call":"heartbeat","command":"heartbeat","uuid":"xxx","device_id":"000001","status":{"Notification":{"value":"Stop"},"BlueLED":{"value":"OFF"},"WhiteLED":{"value":"OFF"},"LightSensor":{"value":2373},"Temperature":{"value":76.32}}}
12:51:14.198 -> ChipChop => {"status":"ok","timestamp":1707483074753}
It says Event will not be fired as 500ms has been exceeded.
Also, when office light was turned off in the above log, I see both a
triggerevent and a
heartbeat event both with
{"Notification":{"value":"Office light turned off."}. Should this even be possible with my code? The only call I have in my code to
ChipChop.updateStatus() for "
Notification" is hard coded to "
Stop".
FYI, this is with your v1.38 cpp and h files.