Repository navigation
Custom Ping does not update status #1740
|
I am using a smartplug to turn a 3D printer on and off. To do this through UpSnap, it requires custom wake and shutdown commands. These both work without issue by calling an API provided by my smarthub (Hubitat) Where I'm running into an issue is the custom ping. The process to get a result is complicated, but through a combination of the hubitat API and processing through n8n, I end up with a url to call that returns a simple "1" for off or "0" for on. my custom ping command is "curl https://192.168.1.5:5678/webhook/key/HubitatParameter/Ronne_Power -k" I can run that command in a browser, through a SSH connection on my NAS, and from within the docker container for UpSnap and it works as intended everywhere, but UpSnap itself refuses to change the icon state for this device. My UpSnap device configuration successfully running the command from inside the docker container.... But again, whether it returns 0 or 1, the object in UpSnap never updates to reflect it. Normal pings work fine |
Replies: 4 comments 1 reply
|
P.S. It would help if I could see ping logs to see what UpSnap actually gets back, but I can't seem to find a way to do that. |
|
UpSnap does not parse the response. It will only set the status if the command failed or succeeded. In your case the command always succeeds regardless of the response. You would need to check the output with something like:
|
|
Got ya. Thanks again. I threw the grp at the end of my curl statement and now it works as expected. Fantastic. |




UpSnap does not parse the response. It will only set the status if the command failed or succeeded. In your case the command always succeeds regardless of the response. You would need to check the output with something like:
curl -s https://example.com/api | grep -qx '0'