I’ve implemented the RPi Garage Monitor Device Type by rich@richlynch.com and have it working fine with a Raspberry Pi Zero W connected to 2 magnetic switches as sensors. The simulator changes the ‘contact’ tile when they’re open, as does the app on my Android phone.
The problem is that the code I’ve added to signal my GPIO pins to trigger a relay to actually open the garage doors only works in the simulator! It’s a ‘toggle’ tile that triggers a web call to 192.168.x.x/action which is the IP of the Pi. When running from the simulator all is good, I press the toggle tile, I see my log files update and I see the relay trigger.
When running the same from the Android phone, the toggle tile does nothing - the Live Log shows nothing.
I thought it might be an internal LAN IP issue, but the status query is on the same IP and port, so that can’t be it.
Scratching my head … any pointers?
Update: here’s my send code (IP redacted for what it’s worth!)
def sendAction(port) {
//def port = getDataValue("port")
//port = convertHexToInt(port)
log.debug("Activating for port ${port}")
try {
sendHubCommand(new physicalgraph.device.HubAction(
method: "GET",
path: "/action",
headers: [
HOST: "192.168.x.x:8080",
]
))
} catch (all) {
debug "Error executing internal web request: $all", null, "error"
}
}