I would be very interested in this, if someone could walk us through on how to have this bash script that @dcjona mentioned run every time at startup, it would be great.
I would love to monitor all my miner’s stats from home assistant too.
Or suggest any other way to get the data to HA
- So i copied the .sh contents and filled in my HA address, selected a topic, entered username and password (that i also set in my HA’s mosquitto broker).
- Opened shellinabox (by clicking the ip address in the HiveOS UI).
- Initial username is user and pw is 1
- There is a command in the initial help lines that lets you change your pwd for ssh and vnc, i suggest you do so
- Pasted all my code - using right click on the background - then pasting in the box that appeared
- Saved (crtl+o) as
hiveos2mqtt.sh and exited nano
sudo bash hiveos2mqtt.sh waited for stuff to download and update
- you can exit the script with crtl+c
From the hive side it seems to work ok.
Unfortunately im getting consecutive connections and disconnections on the Broker side.
1621543112: New connection from 10.0.0.110 on port 1883.
1621543112: New client connected from 10.0.0.110 as mosqpub|29832-rig1 (p1, c1, k60, u'hive_os_1').
1621543112: Client mosqpub|29832-rig1 disconnected.
No idea how to troubleshoot this tbh…
The hive mqtt client is working as intended (i guess), connects, publishes, then disconnects.
I’m guessing the next steps if i get it to work would be to do:
sudo nano /hive/etc/crontab.root
- add a new line
bash -c 'sleep 10 && /home/user/hiveos2mqtt.sh'
- which should run it at every startup.
Again i am a total noob on linux so do these at your own risk.
Now onto reading this data with HA.