muppet3000 / homeassistant-grott

Home Assistant Integration for Grott - MQTT
MIT License
76 stars 17 forks source link

Basic Installation Help #63

Open MSavisoft opened 1 year ago

MSavisoft commented 1 year ago

About 2 months ago I discovered Home Assistant, and installed HA OS on a RaspberryPi. My initial interest was to enable Energy monitoring including a Solax battery, and a Growatt PV array. I was amazed the ease with which I installed the Growatt integration for PV data, and then used the Solax X1 Hybrid G4 Worked Example as a base for getting Battery data. All was going well ... then the PV data became unavailable.

I eventually found it caused was Growatt, not me, and I have been trying to follow the many scattered posts about the problem and possible solutions.

I found muppet3000 / homeassistant-grott and tried to follow the ReadMe. HACS I had, so on to Prerequisites and then to Grott. I do not have Docker, so had to try the Python Application install.

However, it is not clear (to me) where I download the Repository, or where to use the sudo command - and I have read around! Note that I am not familiar with Linux, apart from following the simple instructions to install PiHole on another RPi.

Please can someone clarify how to to this on HAOS? Some of the following instructions look complex, and further help may be required. Thanks for any help.

CK0y0TE commented 1 year ago

I know what you mean. I am a retired Unix/DBA sysadmin and have a really hard time to follow these children. They assume a lot. They don't know how ignorant we are, they are programmers. As a Sysadmin I ve had a few moments with developers, they didn't care about security , clarifying, documenting or cleaning up. BUT, I AM GRATEFULL THESE PEOPLE DO THIS FOR FREE!!! To answer your questions a little bit:

I wish you all the best in finding a complete "hit the keyboard with my head" tutorial. I couldn't. I almost gave up.

MSavisoft commented 1 year ago

Thanks CK0y0TE ... but (as a retired DBA myself!) even you have assumed that I know how to get to a command prompt on HAOS - note I am not familiar with Unix/Linux.

I also am grateful to those who contribute to this work in their own time!

CK0y0TE commented 1 year ago

LOL. You are right! Well, there is an addon that gives you terminal acces within Home assistant Goto Settings-> Addons-> bottom right "Addon Store" search for "ssh" or "web terminal". That is all with the mouse... You were DBA for Oracle/mysql?

MSavisoft commented 1 year ago

Ahah! Thanks - that was the vital clue. Now installed - will try to use it later. I was IBM & MVS based for 40 years - including a lot of work with CICS and DB2.

MSavisoft commented 1 year ago

Tried to use Terminal - cd command worked (though not sure if it should be just as you suggested), then tried wget you suggested, which downloaded just the grott.service file. That on its own did not seem right, so (eventually) managed to delete it using File Editor! Your suggestions to 'find the files', 'alternate link', 'adjust web browser' & 'blob' mean nothing to me, sorry. Using wget, how do I download all the required files?

muppet3000 commented 1 year ago

Hi guys, DevOps team lead here (read: Sysadmin turned Linux bash hacker turned semi-python developer turned CI/CD specialist turned manager because I can't keep up with the rate of change but damn can I herd cats!).

One of the things on my list is to improve the documentation for this integration and in doing so also how to install the prerequisites.

If you're using Home Assistant OS then there's a much simpler option to get Grott up and running and that's by installing the Grott 'add-on', if you Google for 'egguy Grott addon' you should be able to find it pretty easily. There are a couple of extra bits to consider if you want to use it with this integration (which I recommend because this integration formats all the information so you can use it with the energy dashboards etc). I'll find the steps for that and provide another comment when I have them (they're on another ticket and I'm on my phone so they're not easy to track down).

I'm currently away on holiday for a week but I'll try and assist where I can.

muppet3000 commented 1 year ago

The extra thing to do is when you're installing that add-on is to tweak the options show on this image: https://github.com/muppet3000/homeassistant-grott/issues/16#issuecomment-1623172859 You need to enable "Enable Grott MQTT" option and to disable the "Home Assistant plugin" option. After that my integration should then be able to be installed and make use of the data being pushed into MQTT from grott.

If you have any problems let me know, I'd love to get some feedback from a 'beginner' (bonus points for screengrabs) so that I can update the documentation.

CK0y0TE commented 1 year ago

Great! Thank you for the attention

Please dont forget that we need a clone of the files in the custom_components folder: "cd /config/custom_components" "git clone https://github.com/johanmeijer/grott.git" Also I just figured out why it didnt work for me the first time. As it apears, I just could'nt get grott to use the username/passwd for mosquitto. Since auth was on in grott and mosquitto , ... one has to know where to adjust things (and reload). I hope I am right. Still stumbling

We can copy these commands and in the webterminal , by holding "shift"+"right-click mouse" issue paste

CK0y0TE commented 1 year ago

Tried to use Terminal - cd command worked (though not sure if it should be just as you suggested), then tried wget you suggested, which downloaded just the grott.service file. That on its own did not seem right, so (eventually) managed to delete it using File Editor! Your suggestions to 'find the files', 'alternate link', 'adjust web browser' & 'blob' mean nothing to me, sorry. Using wget, how do I download all the required files?

Never mind, I asked one of my sons, see comment above

muppet3000 commented 1 year ago

Great! Thank you for the attention

Please dont forget that we need a clone of the files in the custom_components folder: "cd /config/custom_components" "git clone https://github.com/johanmeijer/grott.git" Also I just figured out why it didnt work for me the first time. As it apears, I just could'nt get grott to use the username/passwd for mosquitto. Since auth was on in grott and mosquitto , ... one has to know where to adjust things (and reload). I hope I am right. Still stumbling

We can copy these commands and in the webterminal , by holding "shift"+"right-click mouse" issue paste

No you don't need to do this at all. If you use the egguy HA OS addon it handles all this for you, it essentially wraps Grott into a handy package so you're running it as part of home assistant.

CK0y0TE commented 1 year ago

Great! Thank you for the attention Please dont forget that we need a clone of the files in the custom_components folder: "cd /config/custom_components" "git clone https://github.com/johanmeijer/grott.git" Also I just figured out why it didnt work for me the first time. As it apears, I just could'nt get grott to use the username/passwd for mosquitto. Since auth was on in grott and mosquitto , ... one has to know where to adjust things (and reload). I hope I am right. Still stumbling We can copy these commands and in the webterminal , by holding "shift"+"right-click mouse" issue paste

No you don't need to do this at all. If you use the egguy HA OS addon it handles all this for you, it essentially wraps Grott into a handy package so you're running it as part of home assistant.

Yes a read that, but I have 2 extra mosquitto devices now that do work (nous a1t smart power outlets). How do I know those will still function. I am a noob afterall and once things work I tend to continue. I will be watching things closely. eguyy too has some missing things in the docu.

cheers to you for your commitment!

muppet3000 commented 1 year ago

MQTT is a message broker so it's just a big queue of messages coming in and then integrations consume only from the topics that they know about. In short: asking more days to MQTT won't affect your existing integration, if it does: just stop the Grott add-on.

Egguy and myself are trying to find some time to coordinate on documentation.

MSavisoft commented 1 year ago

@Muppet3000: Some progress: I installed the Grott addon, enabled Grott MQTT, disabled HA plugin and restarted HA. However, when trying to start Grott, there is an error logged: Got unexpected response from the API: Service not enabled It seems there is some Grott setup that is not in the Configuration. I will follow the Grott docs to do that.

Do I have to copy the Configuration file and change it, or is that included in the Grott addon?

There also is the DataLogger setup - I have tried to connect to my Dongle, but it times out - possibly because it has give inactive after dusk, so I will try again tomorrow.

MSavisoft commented 1 year ago

I have hit a snag. Now the PV is active I tried to connect to the datalogger at its IP of 10.0.0.50, but I get Connection Refused error, whatever browser I try. Using a port scanner it seems there are NO open ports, but I can see no reason in the router that would stop me accessing it. The datalogger is a ShineWifi-X and the Inverter is a MIN 5000TL-XE. Any suggestions?

MSavisoft commented 1 year ago

I have just found suggestions how to use web interface to set the IP which I will try.

MSavisoft commented 1 year ago

After discovering that I should be able to set the datalogger IP using the web page, I have reverted to trying to follow the pre-requisite instructions, specifically Grott. As I have installed Grott as an addon, does that mean I can ignore Python Application steps 2, 3 & 4? How can I check Grott is now running as a service?

If I need to do any of steps 2, 3 or 4, I tried using sudo in the Terminal addon ... but it just responded bash: sudo: command not found. What on earth is bash? It seems to be a scripting language rather than a normal terminal.

I then tried to follow the Configuration section. I found grott/examples/grott.ini, updated it, and saved it over a blank file I found in my config/grott/grott.ini. Is that the correct place?

The Summary page says I should now have a running Grott server - how do I prove that before I try to update the datalogger IP? I do not want to lose any stats sent to the growatt server!

I also had a look ahead at MQTT installation, but got lost when referred to mosquitto.org with no indication how to install on HAOS!

I feel I am computer literate, but this is all bloody confusing, and I am losing hope.

CK0y0TE commented 1 year ago

I have hit a snag. Now the PV is active I tried to connect to the datalogger at its IP of 10.0.0.50, but I get Connection Refused error, whatever browser I try. Using a port scanner it seems there are NO open ports, but I can see no reason in the router that would stop me accessing it. The datalogger is a ShineWifi-X and the Inverter is a MIN 5000TL-XE. Any suggestions?

I had the exact same issue. There are 2 possible solutions I tried that worked. One is per the webinterface at server.growatt.com ( at the dash scroll down and spot "All Device", click it and you can find settings for your datalogger on bottom right, remember the "key/passwd" is either growattYYYYMMDD or datalogYYYYDDMM) Or use the app on your phone: set the logger in hotspot and enter the "Advanced settings" in the setup procedure. Any other suggestion with webbrowsers didn't work for me either EDIT: When fiddling with HA grott I discovered that my Shine X reverted back to the growatt server IP!!! I had to set it back 3 times already. proxy is working for me, I see the logs and the shine app data, but mqqt doesn't play dice with me. I use mqqt HA addon because I have other mqqt devices too.

CK0y0TE commented 1 year ago

I am in the same confused state. I installed mosquito addon from addon store in HA. But the grott addon uses it own user id "grott" hard coded and I am unable to change it despite extra lines in configuration tab of the addon or in the ini file in /config/grott. The documentation refers to addon and component and totally confuses me which is which and what is necessary in combination with what. The devs are aware and on it. But they need time,beer,coffee and cheers. No doubt they ll succeed. But it's their charity and spare time. Let's bear with them.

Op zo 29 okt. 2023 12:19 schreef MSavisoft @.***>:

After discovering that I should be able to set the datalogger IP using the web page, I have reverted to trying to follow the pre-requisite instructions, specifically Grott. As I have installed Grott as an addon, does that mean I can ignore Python Application steps 2, 3 & 4? How can I check Grott is now running as a service?

If I need to do any of steps 2, 3 or 4, I tried using sudo in the Terminal addon ... but it just responded bash: sudo: command not found. What on earth is bash? It seems to be a scripting language rather than a normal terminal.

I then tried to follow the Configuration section. I found grott/examples/grott.ini, updated it, and saved it over a blank file I found in my config/grott/grott.ini. Is that the correct place?

The Summary page says I should now have a running Grott server - how do I prove that before I try to update the datalogger IP? I do not want to lose any stats sent to the growatt server!

I also had a look ahead at MQTT installation, but got lost when referred to mosquitto.org with no indication how to install on HAOS!

I feel I am computer literate, but this is all bloody confusing, and I am losing hope.

— Reply to this email directly, view it on GitHub https://github.com/muppet3000/homeassistant-grott/issues/63#issuecomment-1784072028, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEV42JK5LACOS4DO3WGXRJTYBYUSNAVCNFSM6AAAAAA6OB663OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTOOBUGA3TEMBSHA . You are receiving this because you commented.Message ID: @.***>

muppet3000 commented 1 year ago

I think if you're having problems with the egguy addon then I recommend posting a message over in the github for that so it can be addressed there: https://github.com/egguy/grott-home-assistant-add-on

CK0y0TE commented 1 year ago

I think if you're having problems with the egguy addon then I recommend posting a message over in the github for that so it can be addressed there: https://github.com/egguy/grott-home-assistant-add-on

It works now. I had all the devices under MQTT showing but not under grott. I removed all the "shit" I had done to my setup by doing all three guides (Johan Meijers, egguy and yours) and started all over. I didn't edit /config/grott/grott.ini with MQQT. I just entered it in the addon config with the credentials I have the "HA Addon Mosquitto" setup for my tasmota's : Screenshot 2023-11-02 at 13 28 28 Thanks a bucket of solar for your endless energy in assisting us! (going to buy you a coffee).

EDIT: oh and reboot ofcourse

CK0y0TE commented 1 year ago

After discovering that I should be able to set the datalogger IP using the web page, I have reverted to trying to follow the pre-requisite instructions, specifically Grott. As I have installed Grott as an addon, does that mean I can ignore Python Application steps 2, 3 & 4? How can I check Grott is now running as a service?

If I need to do any of steps 2, 3 or 4, I tried using sudo in the Terminal addon ... but it just responded bash: sudo: command not found. What on earth is bash? It seems to be a scripting language rather than a normal terminal.

I then tried to follow the Configuration section. I found grott/examples/grott.ini, updated it, and saved it over a blank file I found in my config/grott/grott.ini. Is that the correct place?

The Summary page says I should now have a running Grott server - how do I prove that before I try to update the datalogger IP? I do not want to lose any stats sent to the growatt server!

I also had a look ahead at MQTT installation, but got lost when referred to mosquitto.org with no indication how to install on HAOS!

I feel I am computer literate, but this is all bloody confusing, and I am losing hope.

OK. There was no need for terminal acces after all. Is your setup working? Decide if you want to use the "HA Mosquitto" addon which you can install from "addons" in HA or if you will be using the builtin mqtt (mosquitto) from the HACS integration by muppet3000.

See my other comment above with picture: I have the "HA Mosquitto addon" already in my system for other devices that use it. so I do not use the mosquitto option from muppet3000 in grott but, i DO have to fill in the user password credentials inside grott "configuration" tab for the HA addon "Mosquitto". ( If i am wrong here, some will correct me. So far everything is working for me)

If you do NOT use the HA Addon "Mosquitto" and plan to use the mqqt bundled inside Grott, you have to switch both sliders different:

BTW Where is the "buy me a coffee" for these devs?

muppet3000 commented 1 year ago

Glad you've got it sorted.

I'd like to leave this issue open though so I can use it to feed into documentation if that's ok? Is there anything else outstanding?

With regards to the 'where's the buy me a coffee', mine is on my github homepage or on this repo. e.g.: https://github.com/muppet3000/homeassistant-grott/ (there's a cute little 'buy me a beer' button or a paypal beerfund button). There's a bigger version of both here: https://github.com/muppet3000 I'm not sure if egguy has the equivalent, but this is his github page: https://github.com/egguy

I really don't expect anything for this, I'm just trying to help the community the best I can with a hobby that I love.

perfrank commented 11 months ago

Hi I really need some help getting Grott up and running. I am relative new in HA and much more home in Windows environment. And I feel, that the learning curve is not as steep as it used to be.

My setup is HA running native on a x86 computer. The Growatt api integration has worked (sort of), but has stopped some time ago. And i am tiered of Growatt's slow server and limited bandwidth. The proxy solution seems right for me.

I followed the guidelines, except i already have a working MQTT server (installed in HA). It serves data collection from the electricity meter via the HAN port on the meter. One device and 85 entities.

The Grott integration seems to be ok, but shows no devices or entities. I put the grott.ini file in the grott directory and edited it according to the instruktions. But no new entities appear in MQTT. What am I missing? And which additional info may I provide to solve my problem?

Thanks in advance Per

muppet3000 commented 11 months ago

o devices or entities. I put the grott.ini file in the gro

Have you actually got grott running? Are you running Home Assistant OS? If so have you tried using the HomeAssistant Add-on to run Grott instead as it simplifies the process somewhat.

perfrank commented 11 months ago

Hi

Thanks for answering and your time.

Yes, I am on HA OS. That's what I ment with "native". I am not that familiar with the nomenclature in this environment ;-)

In HACS i added the integration from "https://github.com/muppet3000/homeassistant-grott".

I added Grott via Settings - integrations - Add integration. I see Grott in integrations. It shows in Integration entries with no devices and no entities.

image

Does that mean, that it is running? I dont know what to answer, mostly because I dont know what to expect. I'll say yes, because there are no visible errors.

There is no Grott in Settings - Add-ons, and search for "Grott" gives no results.

Thanks again. Best, Per

perfrank commented 11 months ago

Grott running now with egguy's add-on. Thanks :-)

typxxi commented 7 months ago

time to close the topic / issue as it had been solved and nothing new to expect.

MSavisoft commented 7 months ago

After several months pause, I am restarting my attempts at following the instructions to install homeassistant-grott. I will be back with further questions , so please do not close yet!

I think my confusions are caused by the myriad of links to follow in the instructions, and it is not always obvious when to stop following a chain of links, or when to ignore a link.

One major stumbling block is in the Setup MQTT page - I am running HAOS on a RPi4, so I do not understand the instructions for installing mosquitto - presumably as a Local Install - but the Mosquitto Downloads page gives no obvious version to download. Does the HA Mosquitto Broker add-on do the same thing?

CK0y0TE commented 7 months ago

I spent some time to help you as others have helped me. It took me weeks to figure it all out and I totally understand your confusion as i went the same rabithole of links and references of information. So, i tried explaining to you what i did to get it working... What part is not explanatory enough? Seen my comments about mqtt authorization?

"I think my confusions are caused by the myriad of links to follow in the instructions, and it is not always obvious when to stop following a chain of links, or when to ignore a link." Exactly this is very frustrating. Hence my comment. Appearantly my addition is even worse?

BTW isnt your net meter an "esphome" version?

MSavisoft commented 6 months ago

BTW isnt your net meter an "esphome" version?

Not sure what you mean by 'net meter' or 'esphome' I am afraid.

I do thank you and all others who have contributed ... eventually I seem to have found a way through! LIke others, I decided to delete stuff and start again, having tried to distill all the docs and advice ... but largely aiming for the minimum. For others to comment, and maybe to help newcomers, what I actually did was...

Installed the following in my RPi4 hosted HomeAssistant:

Add-on: Mosquitto broker

Configuration changes
None Log No errors seen

Add-on: Grott Beta v2.8

Configuration changes Inverter Type = MIN (which is the reason for v2.8, as MIN may not work with v2.7) Enable grott MQTT = Selected Home Assistant Plugin = NOT selected
Network Port = 5279
Log No errors seen Seems to be IP 172.30.33.3 port 5279 <<< Private address used by? Received packets from radr

HACS Integration: homeassistant-grott

Configuration changes None

Datalogger ShineWifi-X

Configuration changes I think I changed the IP to my HA IP using web interface, using -> All devices -> Datalogger Setting -> Set IP -> Yes + password. But I am not sure of this, and the web interface does not seem to display what the setting currently is!

Results

However, after doing just the above AFAIK, much to my suprise it all seemed to spring into life!

Does this look ok? Is there anything else I can do to check that all is well?

How does HA know where to forward the messages for the growatt server?

Many thanks to all!