If I do cat pipe it tells me running or exited, and I want retrive this response and put it in the binary sensor, how can I do this?
I tried with this but nothing:
Run the command outside of home assistant, and post the full output. I believe docker inspect returns JSON, so we should just be able to use value_template to extract what we need out of the JSON, so the payloads match.
EDIT:
Revisiting this - it looks the escaping is more complicated:
When I do docker inspect it tells me running or exited, I dunno if it is a json
I have difficulty in creating the sensor that can send the command and take the contents of the pipe, if you could help me I would be grateful
Well, instead of trying to fit all the command in the command_line config. Why not have the entire command in a shell file, and then simply call the shell file.
doesn’t work, I can’t do docker inspect directly from the the docker (ha), i need to send it to the pipe and then read the pipe to get the result
I tried this but the sensor remain unknown
Since the response comes from outside home assistant, why don’t you do it the other way?
Use either MQTT or a binary_sensor template using a webhook as a trigger.
Run the docker inspect command directly outside home assistant, and then send the result TO home assistant either other MQTT or the webhook.