ironsheep / RPi-Reporter-MQTT2HA-Daemon

Linux service to collect and transfer Raspberry Pi data via MQTT to Home Assistant (for RPi Monitoring)
GNU General Public License v3.0
442 stars 62 forks source link

Improve instructions - RMTECTRL #97

Closed bsimmo closed 1 year ago

bsimmo commented 1 year ago

Not a bug Documention

https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/blob/master/RMTECTRL.md

Description of problem:

I'm following the instructions, but some of it needs updating and is not so clear. It needs to be kept simple at first (my opinion), using just the default setup a RPi would have as per the installation instructions. I would edit it, but only after I have clarification on a few things.

https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/blob/master/RMTECTRL.md#configuring-the-daemon The commands are now in the default config so we don't need to add them, just find and remove the comment #. Easy enough.

https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/blob/master/RMTECTRL.md#enabling-the-daemon-to-run-external-commands It's a little confusing in the wording. BUT what does raspberrypihostname mean, I copied as is, but it doesn't work? Am I supposed to replace it with something, if so then the host name of what/which Pi, the local one or the HA one? Can it just be the IP address I put if it is the remote MQTT/HA host?

It then talks about additionally the daemon user... and gives a script. But I don't have that script, it is missing. Or is this for any additional scripts we wish to run. If so, could this be clearer in its own topic heading, e.g. Adding your own scripts, and also where to add these into the command of the config file etc. Keep talk about anything that is not part of the default setup out of the main text.

For the testing there is the link to https://github.com/ironsheep/lovelace-rpi-monitor-card#example-control-of-your-rpi-avail-in-daemon-v180-and-later We don't need that for the testing, great for the HA display though. But for testing it should be from the Device Info page image that way it'll not be a template problem and we can see the buttons created AND see them being pressed in the Logbook. It's easy to find this by Settings -> Device & Services -> Mosquitto broker or whichever broker is being used.
Click on the devices number and select the Device. (or use the search feature of HA or the many other ways of getting there :-))

Additional information: Me currently confused as to what raspberrypihostname (edit this is the hostname of the pi it is running on, can this be automated, what if we change the hostname?) is really asking for as it is not working for me as I read it.

Once that is done, the readme could be referenced in the initial setup so more people know of it. At https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/blob/master/README.md#configuration

also the second cat var/log/augh.log has a small spelling error.g = t

ironsheep commented 1 year ago

@bsimmo Sincerely, thank you for all this detail. I'm cleaning this up now.

ironsheep commented 1 year ago

Changes committed and appear in v1.8.5 and later.

ironsheep commented 1 year ago

@bsimmo Please review the updates and let me know what you think.

https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/blob/master/RMTECTRL.md

FondledYeti commented 1 year ago

@ironsheep, not OP but I'm still having a little trouble with this.

The docs suggest sudo chown daemon RPi-mqtt-daemon-script.sh to update permissions of our reporter script. However there is no script of this name in the repo.

There is an rpi-reporter but when I change ownership for that I still have entries in auth.log that suggest the commands are being run by root and not daemon.

I hope this was the right place to post, sorry if I should have opened a new issue, but it seemed related to this documentation request.

Andystew94 commented 1 year ago

^further assistance, please. I am stuck in the same position.

bsimmo commented 1 year ago

I did scan over it and it seemed much better. Just forgot to reply here.

I'll check see what your problem is Ah. Had a read. @FondledYeti and @Andystew94 are you looking at S4 section.

I believe that is for adding any of your own commands to run. So in the setup area you create another entry with the command to a script you may want to run (for example an update script). It is then that scrip/file you are altering the permissions on.

You do not need that for the default setup.

If it is not that, which section are you in?

bsimmo commented 1 year ago

So you may add an update script

[Commands]

update_reporter = /usr/bin/sudo/ place/script/is/update-script.sh 'update request over MQTT'

You would then need to add that through the sections before and then check make it executable as daemon user.

I've not tried it, but that is my take on it.

It will show up as another button in HA.

(as a side note, such an updating script can be found in https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/issues/87)

None of that is needed for the normal three Commands. Just check they're in the config file, add to sudoers. Etc.

ironsheep commented 1 year ago

@Andystew94 and @FondledYeti Sheesh... I think I botched the instructions for that Step. I've updated them please review that step (S4) now and see if (1) the instructions now work and (2) they make sense.

https://github.com/ironsheep/RPi-Reporter-MQTT2HA-Daemon/blob/master/RMTECTRL.md#s4-adjusting-the-ownership-of-our-reporter-script

FondledYeti commented 1 year ago

Hi @ironsheep @bsimmo, thanks for your help clearing that up. @ironsheep the updated instructions work nicely. One thing to note: I tried adding a comment to the systemctl restart command to see if it would show up in the logs like the others do and it causes the command to fail (though it does show up in the logs :)). It's not an issue since you haven't suggested doing that, but you may like to include an alternative suggestion for greping the logs when using that command.

Once again, thanks for the help and thanks for publishing the project!