rianadon / opensprinkler-card

Home Assistant card for collecting OpenSprinkler status
Other
66 stars 8 forks source link

wrong place for this but i cant figure out.. #12

Open docsparks opened 3 years ago

docsparks commented 3 years ago

wasting too much time trying to figure out how to msg you of some sort on github

would like to ask for a refresher in how to go about forking your os-app to my github and using my url for my opensprinkler.

also i have an extremely large homeassistant setup, and appreciate your cards

finally, if at all possible, in opensprinkler software on my pc, when i click a cog on a station, the popup window is just too small for my liking. wishing to do the above for my github fork, where about i do that, or any other advice would be appreciated, ill delete or close this asap

rianadon commented 3 years ago

would like to ask for a refresher in how to go about forking your os-app to my github and using my url for my opensprinkler.

Let me know if you get stuck following the instructions I put in my pull request on the firmware repository.

also i have an extremely large homeassistant setup, and appreciate your cards

I'm glad you like the cards!

finally, if at all possible, in opensprinkler software on my pc, when i click a cog on a station, the popup window is just too small for my liking

Sounds like a css change. If you're interested in contributing your tweaks (I'd love to have them too!), I'd recommend changing www/css/main.css in the OpenSprinkler-App repository.

To test out your changes, there's a gruntfile for building the app but I didn't figure that out. For the website, I was able to get by concatenating a few files together. You can use these commands in a unixy environment, or copy paste works too:

# in the www/css directory, paste jqm.css the main.css into a new file called app.css
cat jqm.css main.css > app.css 

# in the www/js directory, paste jquery.js, main.js, then libs.js into a new file called app.js 
cat jquery.js main.js libs.js > app.js

The developer tools console will show you line numbers inside app.js, but make sure you are editing main.css so you don't lose anything!

You'll need to be hosting these files somewhere. If you know your computer's local network address, you could use python to launch a temporary web server inside the www folder. Then change the JavaScript url (like I described in the pull request) to http://local-ip-address-of-computer:8000/js. For something more permanent, you could copy the www folder to inside Home Assistant's config/www folder (where the custom cards go) and rename it toos. Then your JavaScript url would be http://homeassistant:8123/local/os/js. But be careful - there is a character limit on the JavaScript url length (which is why I named my fork OS-App, not OpenSprinkler-App)!

And then once you're finished, if you can merge your changes into the official OpenSprinkler-App repository, I'll gladly merge them into my fork so you can have both ui changes & the groups & preview features needed for the firmware changes.

wishing to do the above for my github fork, where about i do that

For modifying the frontend, I made a fork of the frontend repository (if you'd like to keep my frontend changes for the groups & other features, you can fork my fork, but doing so will greatly complicate contributing back your changes). To get the github.io url, I renamed the www folder to docs and enabled GitHub pages:

image

Then change JavaScript url as I described in the pull request, but using your fork url.

or any other advice would be appreciated

Good luck! 😁

ill delete or close this asap

I'm happy to continue the conversation here until you get stuff set up. If you run into any bugs with the forks, I've just enabled issues on both of them (they must've been disabled initially since they're forks), and that would be my ideal location.

docsparks commented 3 years ago

Me again, hope all is well. Ive been a bit side tracked, and haven't been able to get too deep into the above, however, myself and a friend of mine have been doing some wild things with additional devices to band-aid the "more than 2" master station limitation.

i've reviewed the commits that @vsoltan has made to the files, and see where the code is there to allow more than 2 masters, he still has the exact amount unchanged at 2, and I can understand the extra coding headache that comes from just having a manually editable number within the actual opensprinkler setup.

could this be as easy of a fix as opening the file on my raspberry pi and adding the additional lines to give me the 5 master zones i need? I haven't reviewed how the os-app handles that part yet to see if that also could handle 5 master stations, or if every last detail of that is hardcoded in, and im basically up against what you posted above, as how to build my own frontend as well as make the changes to the firmware files.

I hate admitting that you also lost me on 'gruntfile' and I was able to understand the self hosting and server part, completely lost me on a few parts after as well, but my main focus on this post is the inquiry of the additional master zones, before I invest any more of my time, anything you can spare to contribute this thought is greatly appreciated. Seriously, thank you.

rianadon commented 3 years ago

I haven't played with that setting, but it looks like it's possible to change in the code; only there seem to be a lot of places that need modification.

The frontend will need modification as well, since there is a isStationMaster function and its dependencies that will need to be updated. However, the sprinkler system will still work even if the frontend is not corrected.

I hate admitting that you also lost me on 'gruntfile'

I managed to figure out the grunt stuff / how to rebuild the frontend. You need to install Node.js and install grunt via npm install --global grunt. Then, every time you update the frontend source code, you need to regenerate the files for the website by running:

grunt buildFW

Ignore the source code block in my previous comment :)

docsparks commented 3 years ago

after over thinking / over engineering how i'd handle it if i could have multiple zones, it would lead me down a hole of needing to create more "virtual stations" that have different masters setup, and then additional programs to handle that.. i came to the conclusion that the most ideal thing for me would be to be able to change which zone /relay is the master zone, via "virtual station" that just sends a web request to itself to change to the ideal zone with the url. i haven't looked into how to implement that yet, not sure if internal web requests to change master zone is already there or not.

from that point i could just have five programs that set which zone is master, and be able to have that run prior to any of my programs that handle my zones..

in example i have a container of water with a pump, that has pre mixed nutrients, another that had straight fresh water, another that has a doser injector attached.

depending on the time of day, i feed the same zones or use the same programs, but i want a different source of water on.

because of that, i think the url method may work best for me. thoughts?

https://github.com/OpenSprinkler/OpenSprinkler-Firmware/issues/187

updated, resolved. baby steps. will get back to you about my other changes, thank you.

rianadon commented 3 years ago

I'm glad you're making progress .The url method isn't pretty but I don't have any better ideas for you.

docsparks commented 2 years ago

Hey! I hope all is well. Im sorry to bother again, but I opened a issue/question on the normal opensprinkler github 8 days ago and no updates. Im Just curious, if for any reason, I would have an issue changing the max number of programs on the openspinklerpi firmware?

Its still a bit out of my realm of ability, little rusty at the moment, but if I can even confirm it wouldnt be a memory issue, I guess it would be time to start diving in. Any help is appreciated.

Thanks

https://github.com/OpenSprinkler/OpenSprinkler-Firmware/issues/199 https://github.com/OpenSprinkler/OpenSprinkler-Firmware/issues/199

rianadon commented 2 years ago

Hey! I just saw you got a reply. Hopefully your question is answered!