for he first time i have bought an raspberry pi
i dont use it for HA, but i want to create a sensor to see if my raspberry is online
i cant find an sensor/integration for that, only for remote gpio
so how can i create a sensor or healtcheck sensors for my remote raspberry?
Perhaps you could use the Ssh Sensor available in HACS to gather some info from the CLI. CPU temp is useful but you can format your own command if need be.
That is what the sensor is for. perhaps you should do ‘apt install sensors’ and grep the output from that! But the choice is yours?
I am of course assuming that you are using raspian or another linux distro on the Pi?
if you need more information about the PI’s status you can also install glances on your pi and use the glances integration in HA to show different sensors. Glances itself exposes lots of information about the system in its API but HA component only monitor few of them but they are already enough.
Well I had not even looked at glances but having done so now I have installed it on a few nodes and found it far better than my previous suggestions. Each of course has its own use case. Thank you for putting that forward.
No it doesn’t. At the end of the integration page that @serkank posted is a list of available resources from glances and below it a remark, that not all of these might be available on every system.
Maybe you can use the ssh sensor to send the command
@pergola.fabio so as a suggestion, here is what I did to overcome shortcomings of the HA integration.
if you do an API call with GET to this url, http://{glances server IP@}:61208/api/3/all you can get all the available information back in JSON format. for my Pi, i have the uptime information there.
have a look at the API documentation https://github.com/nicolargo/glances/wiki/The-Glances-RESTFULL-JSON-API
then you can use a rest sensor to monitor this missing metrics.
but another thing, the value you get from uptime sensor is just text. if you are going to use it in an automation then there needs to be away to convert it to minutes or hours.