Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve instructions - RMTECTRL #97

Closed
bsimmo opened this issue Apr 24, 2023 · 9 comments
Closed

Improve instructions - RMTECTRL #97

bsimmo opened this issue Apr 24, 2023 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@bsimmo
Copy link

bsimmo commented Apr 24, 2023

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

@bsimmo bsimmo added the bug Something isn't working label Apr 24, 2023
@ironsheep ironsheep self-assigned this Apr 30, 2023
@ironsheep
Copy link
Owner

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

ironsheep added a commit that referenced this issue May 1, 2023
- Handle re-subscription if MQTT broker restarts (#99)
- Simplify installation / setup documentation (#97)
- Repair bug in running shell to execute commands
@ironsheep
Copy link
Owner

Changes committed and appear in v1.8.5 and later.

@ironsheep
Copy link
Owner

@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
Copy link

@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
Copy link

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

@bsimmo
Copy link
Author

bsimmo commented May 19, 2023

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
Copy link
Author

bsimmo commented May 19, 2023

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 #87)

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

@ironsheep
Copy link
Owner

ironsheep commented May 21, 2023

@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
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants