@VietNgoc
thanks for letting me know that you’re aware of this bug/challenge. And I agree with @RickFurtado, building reliable automations require reliable sensors.
What do you think about create a service or action (since 2024.10) to reload the integration. We could schedule a regular reload and the sensors are updated, at least once a night.
Anyone else using this in the US? I’m using America/Denver time zone and Next Full Moon appears off by 1 day (11 and a half hours). According to Google Calendar Next Full Moon is 11/15 2:29pm, lunar phase integration says 11/16 1:58am
Same here in Europe, Zurich.
In integration next full moon is set for Nov 16, 8.58 am. But timeanddate.com as few other full moon calendars have next full moon already 10 hours earlier. Nov 15, 22.28 pm.
Same, Lunar Phase is late on the next full moon by 16.5 hours for me both in the card and the entity state.
@VietNgoc I love the concept of this integration, but I think you need to focus on functionality and accuracy before fancy new features. The new moon-to-horizen graph is cool and all that, but there’s no accesible data. And quite frankly considering other inconsistancies I won’t trust its accuracy. I’ll keep the integration for a bit in hopes that these issues can be resolved, but it’s not going to last if all it is is pretty and cool.
I appreciate your work on this and remain hopeful.
Hi! Cool project, thank you!
Would like to print the next fullmoon on an oled display. How should I create the sensor in yaml (platform?)? I searched the suggestions from the code-editor but didn’t find anything moon-related . Thanks for your help and best regards!
My lunar phase integration creates a sensor called sensor.christchurch_next_full_moon (Christchurch is my location). It contains the date and time of the next full moon.
How are you setting up your OLED? Assuming it is esphome.
if (id(next_fullmoon).has_state()) {
it.printf(64,63, id(font1), TextAlign::BOTTOM_CENTER , "%d.%B %Y", id(next_fullmoon).state);
my sensor:
sensor.schafisheim_next_full_moon
I’ve not tried to used entity-id instead of entity, but as far as I understood both should be possible. Will try anyway…
I wasn’t sure about the “platform” I should reference to and therefore tried “homeassistant”. Do you think this is correct or do you maybe see another mistake I made?
I can successfully print time, date, temperature, humidity and WiFi-status to this display, communication seems to work fine.
Thanks you and best regards!
I checked the logs on the device-api, the sensor is not mentioned there. The only thing I could find about lunar-phases is in the core-log:
Logger: homeassistant.helpers.frame
Source: helpers/frame.py:189
First occurred: November 13, 2024 at 7:46:38 PM (1 occurrences)
Last logged: November 13, 2024 at 7:46:38 PM
Detected that custom integration 'lunar_phase' calls async_forward_entry_setup for integration, lunar_phase with title: Schafisheim and entry_id: 01JCKDJP373R9GH0Z0DKZ1J1TC, which is deprecated and will stop working in Home Assistant 2025.6, await async_forward_entry_setups instead at custom_components/lunar_phase/__init__.py, line 50: await hass.config_entries.async_forward_entry_setup(config_entry, "sensor"), please create a bug report at https://github.com/ngocjohn/lunar-phase/issues
And after installing the new code, the device seems to have connection-issues. When I start the log-output in esphome it takes longer to connect to the device and after a few seconds the connection breaks. Submitting sensor-values seems to work fine so far.
Do you think the sensor-syntax should work like that? Is there another place to search logs?
Thanks for your help and have a great day - cheers!
Sorry mate, I have no idea how ESP Home works. But the sensor has a timestamp class. Isn’t there any way to calculate the state to the normal date in esphome?
edit:
After a quick look at how esphome works, I thought you could create a new sensor using the helper that only shows the state from integration as ‘text’. So you can then simply import it into esphome as a normal text sensor.
Thanks a lot for your time and help! And not a very used coder, I’m learning day by day.
What I don’t understand: why do I need this helper-sensor? Is it not possible to use the sensor lunar-phases creates?
I’ve found this Publish timestamp into text_sensor - ESPHome - Home Assistant Community
and therefore tried the following - without success so far:
I still guess that platform is wrong.
However, I’m not really used with templates. Thanks to your screenshot I managed to create the sensor, now I’ll try to get the string to my display.
Will report progress, thank you very much!
does get the date and time into esphome. You can see it in the esphome log
'sensor.christchurch_next_full_moon': Got state '2024-11-16T08:58:14+00:00'
[23:20:26][D][text_sensor:064]: 'Next Full Moon': Sending state '2024-11-16T08:58:14+00:00'
By the way, your log is not the esphome log, it is the HA log.
Hey guys
thanks a lot for your help, I finally got it sorted! And I learned a lot about using the template-editor for testing and importing sensors to my ESP32-configs. I managed to import a binary sensor myself which feels like I climbed the Mount Everest
For some reason before esphome didn’t know anything about the imported textsensor. After restarting from scratch I could reproduce nickrout’s results. I then started to understand what a text-sensor delivers and that the string-output from sensor.schafisheim_next_full_moon is too long for my display. From this point I was able to follow VietNgoc’s explanations and to format the string as desired. Thank you so much guys, huge learning to the weekend start!