I’m trying to monitor the Google coral Rest server service to see if it’s operational and notify me if it fails, whic it does from time to time, even though I reboot the server each night. It’s easy enough to check on the service. I’ve tried various methods without success and am looking for some help to figure out the best method, hopefully one that returns results that I can display in a Lovelace card.
This is the switch I tried:
# - platform: command_line
# switches:
# google_coral_svc:
# command_on: "/usr/bin/curl -X POST -F image=@/config/www/truck.jpg 'http://localhost:5000/v1/vision/detection'|grep true"
# command_off: "/usr/bin/curl -X POST -F image=@/config/www/truck.jpg 'http://localhost:5000/v1/vision/detection' |grep true"
# command_state: "/usr/bin/curl -X POST -F image=@/config/www/truck.jpg 'http://localhost:5000/v1/vision/detection' |grep speed"
# value_template: '{{ value == "Speed" }}'
# friendly_name: Google Coral Service
Command_state ended up hitting the server ever 30 seconds, and I can see the results in the servers log, but the switch didn’t return anything usable. I also tried using the TCP service call, but I don’t know how to elicit a usable response.
Here’s the output I get from the server service Using the command line:
I think I need to use the command line function somehow and extract the result “true” at the end of the output to show the service is up and working.
So, anyone have any ideas I can try? I successfully ported Rob Coles code to my NUC, but I’m just not very good with json and templates… and this all goes deeper than my current knowledge base.
Jeff