[ST Edge] Breaking boundaries: supporting Blue Iris motion alerts and Shelly wifi Motion Sensors

I’m sorry for some reason I was thinking you were using the LAN presence driver. My bad.

Let me get back to you tomorrow. Late here now.

Don’t waste any more time on this until I can confirm something. It may very well be that I have to get you a patched edgebridge.

Looking at the commits in github, it seems the lines I referenced were recently added. That seems to be what is preventing a GET from going through because the data_bytes are ‘None’ instead of actual data. That would also imply that others that have this working are on an earlier version of edgebridge.

To test my theory, I think I’ll try installing the prior version of edgebridge temporarily to see if it begins working. No rush on the fix, I appreciate all that you are doing.

You’re right.

Oh heck, who am I kidding; not going to be able to get to sleep thinking about this! I’m uploading an edgebridge.exe file to a folder called prelim in the repository. Please download and replace your version and let’s hope this fixes things.

Hopefully I haven’t screwed things up worse in my grogginess…

Oh, didn’t see your update. I did install the prior edgebridge to confirm it works. The log says,

2022-10-08T06:10:03.461425252+00:00 DEBUG LAN Motion Device Driver  driver device thread event handled
2022-10-08T06:15:14.283272302+00:00 DEBUG LAN Motion Device Driver  Accepted connection from 192.168.80.11:54040
2022-10-08T06:15:14.292846635+00:00 DEBUG LAN Motion Device Driver  Received:  POST /192.168.80.11/GET/doorway/motion/active HTTP/1.1
2022-10-08T06:15:14.309324302+00:00 INFO LAN Motion Device Driver  Message from doorway: command=motion, state=active
2022-10-08T06:15:14.315107635+00:00 INFO LAN Motion Device Driver  <Device: 6d0e2bbd-c771-4872-9cc6-31c4f371a080 (Doorway camera motion)> emitting event: {"attribute_id":"motion","capability_id":"motionSensor","component_id":"main","state":{"value":"active"}}
2022-10-08T06:15:14.346144635+00:00 DEBUG LAN Motion Device Driver  driver device thread event handled
2022-10-08T06:15:44.352270649+00:00 INFO LAN Motion Device Driver  <Device: 6d0e2bbd-c771-4872-9cc6-31c4f371a080 (Doorway camera motion)> emitting event: {"attribute_id":"motion","capability_id":"motionSensor","component_id":"main","state":{"value":"inactive"}}
2022-10-08T06:15:44.370137316+00:00 DEBUG LAN Motion Device Driver  driver device thread event handled

Let me try your prelim version to confirm it also works. I’ll try to be quick so you can get some sleep. :slight_smile:

Bingo! The prelim version of edgebridge.is also working.

Fri Oct  7 23:36:00 2022  Forwarding Bridge Server v1.2221091750 (for SmartThings Edge)
Fri Oct  7 23:36:00 2022   > Serving HTTP on 192.168.80.11:8088
Fri Oct  7 23:37:16 2022  **********************************************************************************
Fri Oct  7 23:37:16 2022  GET request received from: ('192.168.80.11', 54419)
Fri Oct  7 23:37:16 2022  Endpoint: /doorway/motion/active
Fri Oct  7 23:37:16 2022  >>>>> Forwarding to SmartThings hub
Fri Oct  7 23:37:16 2022  Sending POST: http://192.168.80.10:54713/192.168.80.11/GET/doorway/motion/active to 192.168.80.10:54713
Fri Oct  7 23:37:17 2022  Message forwarded to Edge ID e8a1a0b7-32e4-4882-8d38-45a96ead543d
Fri Oct  7 23:37:17 2022  Response sent

I can tell it went through because it triggered the routine to turn on the porch light. (I’m confusing my neighbor, so it’s probably time to stop fiddling and get some sleep). Thanks for all your help.

2 Likes

I’m really sorry for all the hassle! But I’m grateful for your patience and glad we found the issue. I’ll update the repository as soon as I can later today.

2 Likes

To the contrary, I’m very grateful to have new capabilities thanks to you. A few initial hiccups is well worth it and I learned more about debugging and CLI.

Thank you!

1 Like

Glad you got it figured out! I’ll say I’m confused why I didn’t have the same experience but I suppose as long as it works, I’ll be thankful.

Reminder to all that I am posting updates specifically regarding the edgebridge server app in a separate topic now. It can be found HERE.

All files have now been updated in the github repository to fix the problem discussed above.

1 Like

My theory is you are running the prior version of edgebridge. The one I was running was updated a couple weeks ago and introduced the bug.

1 Like

Woops, new update to the problem below.

I changed ShellyMotion2 Blind time from 5 minutes to 1 minute. The 5 minutes is a wait time before the ShellyMotion2 will report again.

But that doesn’t explain why logcat saw the lanmotion inactive, and edgebride debug didn’t log it. Why is that?

Nevermind again, it’s because I set the Auto-revert delay to 8 seconds in the ShellyMotion2 LAN Motion driver.

I better stop posting. Sorry, my error. There never was a problem.

Old news below.

Do I have something configured wrong in ShellyMotion2?
It won’t send POSTs to edgebridge again, till I boot it.
I have ShellyMotion2 driver installed.

ShellyMotion2 device will only POST to edgebridge once.
a smartthings app routine turns on a light
Then I have to boot shellymotion2 to send agaion.
shellymotion2 has latest firmware upgrade.

shellymotion device has http://10.0.0.3:8088/ShellyMotion2/motion/active programmed in Motion Detected.
shellymotion device has http://10.0.0.3:8088/ShellyMotion2/motion/inactive programmed and enabled in End of Motion Detected.

edgebridge is running with the debug option.
edgebridge debug captured the lan motion device active, but not the lan motion device inactive POST
smartthing CLI logcat detects the shellymotion2 clear in 8 seconds and a routine turns off a light.
after I booted the shellymotion2 device and activated motion, edgebridge debug logged the inactive POST.

supporting edgebridge debug logs and smartthing logcat logs below:

2023-01-04T12:57:52.241355968+00:00 DEBUG LAN Motion Device Driver driver device thread event handled
2023-01-04T12:58:12.252054414+00:00 WARN LAN Motion Device Driver Valid Bridge server address not configured
2023-01-04T12:58:12.255334414+00:00 ERROR LAN Motion Device Driver Registration with Bridge Server failed for LAN Motion Device
2023-01-04T12:58:12.258438372+00:00 INFO LAN Motion Device Driver Scheduling registration retry
2023-01-04T12:58:12.297057372+00:00 DEBUG LAN Motion Device Driver driver device thread event handled
2023-01-04T12:58:12.302083706+00:00 DEBUG LAN Motion Device Driver driver device thread event handled
2023-01-04T12:58:25.912507999+00:00 DEBUG LAN Motion Device Driver Accepted connection from 10.0.0.3:41084
2023-01-04T12:58:25.997153957+00:00 DEBUG LAN Motion Device Driver Received: POST /10.0.0.244/GET/ShellyMotion2/motion/active HTTP/1.1
2023-01-04T12:58:26.007579374+00:00 INFO LAN Motion Device Driver Message from ShellyMotion2: command=motion, state=active
2023-01-04T12:58:26.011046541+00:00 INFO LAN Motion Device Driver <Device: 974d109b-360b-4940-a2a2-08931ff55bac (LAN Motion Device)> emitting event: {“attribute_id”:“motion”,“capability_id”:“motionSensor”,“component_id”:“main”,“state”:{“value”:“active”}}
2023-01-04T12:58:26.043664374+00:00 DEBUG LAN Motion Device Driver driver device thread event handled
2023-01-04T12:58:32.280984666+00:00 WARN LAN Motion Device Driver Valid Bridge server address not configured
2023-01-04T12:58:32.284689+00:00 ERROR LAN Motion Device Driver Registration with Bridge Server failed for LAN Motion Device
2023-01-04T12:58:32.287994+00:00 INFO LAN Motion Device Driver Scheduling registration retry
2023-01-04T12:58:32.293733625+00:00 DEBUG LAN Motion Device Driver driver device thread event handled
2023-01-04T12:58:32.298791333+00:00 DEBUG LAN Motion Device Driver driver device thread event handled
2023-01-04T12:58:34.053299292+00:00 INFO LAN Motion Device Driver <Device: 974d109b-360b-4940-a2a2-08931ff55bac (LAN Motion Device)> emitting event: {“attribute_id”:“motion”,“capability_id”:“motionSensor”,“component_id”:“main”,“state”:{“value”:“inactive”}}
2023-01-04T12:58:34.075805083+00:00 DEBUG LAN Motion Device Driver driver device thread event handled
2023-01-04T12:58:52.304113002+00:00 WARN LAN Motion Device Driver Valid Bridge server address not configured
2023-01-04T12:58:52.307606794+00:00 ERROR LAN Motion Device Driver Registration with Bridge Server failed for LAN Motion Device
2023-01-04T12:58:52.310710627+00:00 INFO LAN Motion Device Driver Scheduling registration retry
2023-01-04T12:58:52.397113669+00:00 DEBUG LAN Motion Device Driver driver device thread event handled
2023-01-04T12:58:52.402160669+00:00 DEBUG LAN Motion Device Driver driver device thread event handled
2023-01-04T12:59:12.326926338+00:00 WARN LAN Motion Device Driver Valid Bridge server address not configured
2023-01-04T12:59:12.330187796+00:00 ERROR LAN Motion Device Driver Registration with Bridge Server failed for LAN Motion Device
2023-01-04T12:59:12.334754504+00:00 INFO LAN Motion Device Driver Scheduling registration retry
2023-01-04T12:59:12.399795004+00:00 DEBUG LAN Motion Device Driver driver device thread event handled
2023-01-04T12:59:12.404899296+00:00 DEBUG LAN Motion Device Driver driver device thread event handled

pi@raspberrypi:~/Documents/smartthings/edgebridge-main $ sudo systemctl stop edgebridge.service
pi@raspberrypi:~/Documents/smartthings/edgebridge-main $ ./edgebridge4pi -d
Wed Jan 4 05:53:45 2023 Forwarding Bridge Server v1.2221091750 (for SmartThings Edge)
Wed Jan 4 05:53:45 2023 > Serving HTTP on 10.0.0.3:8088
Wed Jan 4 05:55:11 2023 **********************************************************************************
Wed Jan 4 05:55:11 2023 GET request received from: (‘10.0.0.244’, 52434)
Wed Jan 4 05:55:11 2023 Endpoint: /ShellyMotion2/motion/active
Wed Jan 4 05:55:11 2023 >>>>> Forwarding to SmartThings hub
Wed Jan 4 05:55:11 2023 Sending POST: http://10.0.0.223:39271/10.0.0.244/GET/ShellyMotion2/motion/active to 10.0.0.223:39271
Wed Jan 4 05:55:12 2023 Message forwarded to Edge ID e8a1a0b7-32e4-4882-8d38-45a96ead543d
Wed Jan 4 05:55:12 2023 Response sent
Wed Jan 4 05:55:24 2023 Pingreq
Wed Jan 4 05:55:24 2023 Response sent

booted shellymotion device via URL 10.0.0.244

Wed Jan 4 05:58:25 2023 **********************************************************************************
Wed Jan 4 05:58:25 2023 GET request received from: (‘10.0.0.244’, 52434)
Wed Jan 4 05:58:25 2023 Endpoint: /ShellyMotion2/motion/active
Wed Jan 4 05:58:25 2023 >>>>> Forwarding to SmartThings hub
Wed Jan 4 05:58:25 2023 Sending POST: http://10.0.0.223:39271/10.0.0.244/GET/ShellyMotion2/motion/active to 10.0.0.223:39271
Wed Jan 4 05:58:26 2023 Message forwarded to Edge ID e8a1a0b7-32e4-4882-8d38-45a96ead543d
Wed Jan 4 05:58:26 2023 Response sent
Wed Jan 4 06:00:24 2023 Pingreq
Wed Jan 4 06:00:24 2023 Response sent
Wed Jan 4 06:05:24 2023 Pingreq
Wed Jan 4 06:05:24 2023 Response sent
Wed Jan 4 06:06:53 2023 **********************************************************************************
Wed Jan 4 06:06:53 2023 GET request received from: (‘10.0.0.244’, 52435)
Wed Jan 4 06:06:53 2023 Endpoint: /ShellyMotion2/motion/inactive
Wed Jan 4 06:06:53 2023 >>>>> Forwarding to SmartThings hub
Wed Jan 4 06:06:53 2023 Sending POST: http://10.0.0.223:39271/10.0.0.244/GET/ShellyMotion2/motion/inactive to 10.0.0.223:39271
Wed Jan 4 06:06:53 2023 Message forwarded to Edge ID e8a1a0b7-32e4-4882-8d38-45a96ead543d
Wed Jan 4 06:06:53 2023 Response sent
Wed Jan 4 06:10:24 2023 Pingreq
Wed Jan 4 06:10:24 2023 Response sent
Wed Jan 4 06:12:20 2023 **********************************************************************************
Wed Jan 4 06:12:20 2023 GET request received from: (‘10.0.0.244’, 52436)
Wed Jan 4 06:12:20 2023 Endpoint: /ShellyMotion2/motion/active
Wed Jan 4 06:12:20 2023 >>>>> Forwarding to SmartThings hub
Wed Jan 4 06:12:20 2023 Sending POST: http://10.0.0.223:39271/10.0.0.244/GET/ShellyMotion2/motion/active to 10.0.0.223:39271
Wed Jan 4 06:12:20 2023 Message forwarded to Edge ID e8a1a0b7-32e4-4882-8d38-45a96ead543d
Wed Jan 4 06:12:20 2023 Response sent
Wed Jan 4 06:15:24 2023 Pingreq
Wed Jan 4 06:15:24 2023 Response sent
Wed Jan 4 06:20:24 2023 Pingreq
Wed Jan 4 06:20:24 2023 Response sent

My ShellyMotion2 routine stopped working.

While troubleshooting I enabled ./edgebridge4pi -d
It complained about registrations.
I deleted the LAN Motion Device driver and reinstalled it and the routine worked.

But when I ctl<d out of the edgebridge4pi -d, and sudo systemclt restart edgebridge.service, the routine didn’t work. and logcat stopped seeing events for LAN Motion Device Driver.

I rebooted the HUB and everything worked.

Is it normal to have to reboot the HUB if edgebridge goes down?

Have you considered switching to my Shelly Driver? Using a LAN Motion device in combination with edgebridge is certainly one way to do things, but you might find my Shelly driver to be a bit simpler, as it does not require edgebridge.

But to answer your question, no, you shouldn’t normally have to reboot your hub, but sometimes it seems to be the only solution!

What do you mean by this? What exactly was the message?

No, I didn’t know I could use the Shelly Device Driver V1.6 to do ShellyMotion2. I tried it and it works. So I deleted the LAN motion. I thought ShellyMotion2 only worked on the LAN device and that’s the way it had to be. I got a lot of reading to do.

I also tried the other Shelly devices (flood, DW, and HT) with the V1.6 driver. They don’t work, but knew they probably wouldn’t because they go to sleep. No route to host.

I know you’re working on that and you said to use MQTT. I’m headed over to your MQTT topics next. I see you left me a message there.

I’m sorry I deleted all my logs after troubleshooting the registration errors, and I don’t remember the exact text messages regarding registration.

The only battery-powered device that works reliably with the Shelly Device Driver V1.6 driver is the Motion device. The others are going to require an MQTT setup with my Flood driver, which I’m expanding to the other battery devices.

Still fighting issue with registrations. Downloaded latest .exe
Registrations file wasn’t blank but edgebridge reporting no registrations on startup.
Deleted everything, rebooted hub, moved .exe to new location and now it doesn’t even seem to be creating the .registrations file anymore? I’m lost
Update Got past registration issue but now I’m getting hung with the POST issue it seems
Nothing has changed on blueIris side from what once worked.

GET request received from: (‘192.168.1.6’, 65480)
Tue Jan 17 22:41:24 2023 >>>>> Forwarding to SmartThings hub
Tue Jan 17 22:41:24 2023 Sending POST: http://192.168.1.59:38053/192.168.1.6/GET/Garage/motion/active to 192.168.1.59:38053
Tue Jan 17 22:41:26 2023 FAILED sending message to Edge hub [‘192.168.1.59’, 38053]

Just want to say thanks for this. Finally got around to updating my blue iris motion integrations since they stopped working a few months ago and it’s awesome you’ve created something that works locally! I struggled a bit with getting python working on my windows 7 machine but eventually figured it out.

3 Likes

That’s great. Glad it’s meeting your needs. :+1:t3:

1 Like

I’ll echo the sentiment (again). @TAustin , you really created something fantastic for Blue Iris users. I have a motion sensor just for packages. I have another for when people are in my driveway vs just vehicles. The response times shows up on par with Zwave sensors in the same area.

Thanks again for keeping this integration alive with the transition.

2 Likes