since I haven't heard from any developer I had the impression that I was on my own. Not nice but as developer myself I had to find a workaround, daily business.
Forcing the entrycom to plain-text send a user:password wasn't possible and getting ZWay to reply in a RFC compliant way, proved a tad more difficult that my spare time would allow.
ZWay doesn't reply with a www-authenticate header hence we need to work around this.
So I went for the dirty hack. I set up a python webserver on my razberry (meaning, I started the "researched and destilled from the internet"-script below) that receives proper http-get requests from the entrycom and then relays them in a inproper way to ZWay.
Code: Select all
#!/usr/bin/python import os, SocketServer from BaseHTTPServer import BaseHTTPRequestHandler class MyHandler(BaseHTTPRequestHandler): def do_GET(self): if self.path == '/motiondetected': os.system('curl -u user:passwd -v http://127.0.0.1:8083/ZAutomation/api/v1/devices/LightScene_165/command/on') elif self.path == '/noisedetected': os.system('curl -u user:passwd -v http://127.0.0.1:8083/ZAutomation/api/v1/devices/LightScene_166/command/on') elif self.path == '/doorbellrung': os.system('curl -u user:passwd -v http://127.0.0.1:8083/ZAutomation/api/v1/devices/LightScene_167/command/on') elif self.path == '/carddetected': os.system('curl -u user:passwd -v http://127.0.0.1:8083/ZAutomation/api/v1/devices/LightScene_168/command/on') else: print self.path self.send_response(200) httpd = SocketServer.TCPServer(("", 8080), MyHandler) httpd.serve_forever()
All this shouldn't be necessary, but not having the events in Zway was no alternative. And I wanted to help out those that ran/run into the same problems.
Now I can start preparing for the next Halloween Event. Triggering MQTT Actors is the final piece that is still missing, then I am good to roll/scare.