Hours of Daylight

Yes, I did. You probably need to run the custom_updater.check_all service manually to see it, because I think that only runs automatically at startup, then once a day after that.

Yeah I think the card takes up yo an hour to show it and I realise now 2 minutes is not an hour lol/ I only just got a bunch of updates so I’m sure sun will show soon.

He also made a change in the way it works I think. Something about some process that updates his own json file once an hour from individual json files rather than having the component use the individual json files directly as it used to. Honestly, I’m not sure I like the change, and I haven’t updated custom_updater myself in quite a while. In fact, I’m thinking of removing it from my system because the only custom components I’m using are my own and the only reason I installed custom_updater in the first place was to make sure it worked with my custom components. :slight_smile:

Just got it now. New updater works great…

1 Like

Hi, I am trying to set up the enhanced sun component on 0.88 but get the following error. Is this something I am doing wrong? sun.py is in config/custom_components/sun.py
Cheers,
James

Log Details (ERROR)

Sat Feb 23 2019 09:06:43 GMT+0000 (Greenwich Mean Time)

Error loading custom_components.sun.automation. Make sure all dependencies are installed

Traceback (most recent call last): File “/usr/src/app/homeassistant/loader.py”, line 147, in _load_file module = importlib.import_module(path) File “/usr/local/lib/python3.7/importlib/init.py”, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File “<frozen importlib._bootstrap>”, line 1006, in _gcd_import File “<frozen importlib._bootstrap>”, line 983, in _find_and_load File “<frozen importlib._bootstrap>”, line 962, in _find_and_load_unlocked ModuleNotFoundError: No module named ‘custom_components.sun.automation’; ‘custom_components.sun’ is not a package

Do you still get the error after you restart?

See this post for more discussion on this topic.

Yes even after a restart. I was not getting all the monitored attributes either just the standard sun component ones. Actually, I just saw the linked thread and tried someone’s suggestion to create init.py & after a restart the monitored attributes finally showed up, but the error still exists.

Interesting. I did not experience that on the 0.89 dev branch. But apparently I didn’t test enough. :frowning: The automation was getting turned off. When I tried to turn it back on I saw the errors again.

You could try the following if you’d like. (I tried this on my dev checkout and it seems to work. Of course, I thought it was working before, too.) You may have to adjust depending on how you installed HA. If you do, let me know how it goes. BTW, this assumes my sun.py is now located in custom_components/sun/__init__.py.

cd custom_components
sudo -u homeassistant ln -s /srv/homeassistant/lib/python3.5/site-packages/homeassistant/components/automation/sun.py sun/automation.py

Hi, this has been very useful for me. However i am now after the time minus next sunrise and sunset. i.e. how many hours:minutes are remaining till next one. has anyone tried that please?

Sorry, it’s not quite clear what you’re asking. Can you try asking a different way maybe?

Hello how did you get those ‘sunrise’ and ‘sunset’ values?

I’ve installed the custom sun component on this page and it does not appear for me:

If there is a way of getting todays sunrise and sunset, not the next one, that would be what I’m after.

There are setup options you need to configure… did you follow the instructions?

2 Likes

Thanks, that was it. My config was still using the old sun settings, after a Git Pull and a reboot it’s all working as intended. :slight_smile:

Thanks pnbruckner for this enhancement, really handy to be able to use todays sunrise and sunset for solar stats

I am curious on what you came up with the WU API since I have had mine for years now. What type of sensors did you come up with?

But honestly I’m not sure it still works – the WU API that is.

Thanks I was thinking the same too.

Phil question about adding your sun2 to HACS. I tried to add it as a integration but it would not let me add it. Says “Could not add ‘pnbruckner/ha-sun2’ with type ‘integration’ at this time”. Am I adding it wrong? I saw on the repository about adding to HACS but it was not 100% clear on how.


Added as a custom repository

Yeah that is what I tired to do but it would not let me add it as an integration. I may need to reboot been acting wonky today.

try adding it by entering


That is use the full url…
2 Likes