I have recently started playing the game Valheim and hosting a dedicated server to host for some friends i play with. I would like be able to create sensors in home assistant to let me know information about the server and who or how many people are connected etc. I am running this docker container.
In the readme it has a section for a status webserver and writes updates to /status.json. Could we create sensors that scrape that file for information or what would be the best way to injest that information? Anyone have any insight or ideas?
Ok so i’ve got some updates. On the container side I enabled STATUS_HTTP and PUBLIC_SERVER. Then i exposed port 80:80 to the host:container and at the point i could browse to http://server.ip/status.json and get values.
I initially tried the rest integration to get a bunch of attributes/sensors at once. but could never get it to go with an error of setup not defined? so i switched to the restful sensor option and created the 4 that i wanted.
Im only hoping the players one will work as the json syntax changes. How else could i manage that info? it would be cool to have an auto-entites card show who is online. Below is the JSON output im using.
Hi again,
I tried duplicating your sensors but they are not working for me. I can not even see the sensors created in history tab. I can successfully browse to my json file and see it. It is on port 2480 though. So my url looks like http://IPADDRESS:2480/status.json. Would that cause problems?
Any help is appreciated.
Hello,
I got it working by putting that url behind my reverse proxy. For some reason it would not connect to the address when it was http. Putting it through the proxy with a valid SSL cert resolved the issue. I also put my rest sensors in a different format that is a little cleaner. I’ll include it here for reference.
Thank you for your help!