Closed Airfranse closed 3 years ago
I tried it with homassistant time with the result: 1x off, 1x on and then no further actions:
[00:08:26][C][mqtt.switch:039]:` Command Topic: 'esp_co/switch/esp_co_onboard_led/command' [00:08:30][D][switch:029]: 'ESP CO Onboard LED' Toggling OFF. [00:08:30][D][switch:045]: 'ESP CO Onboard LED': Sending state OFF [00:08:30][D][main:282]: Schalter Off! [00:08:35][D][switch:029]: 'ESP CO Onboard LED' Toggling ON. [00:08:35][D][switch:045]: 'ESP CO Onboard LED': Sending state ON [00:08:35][D][main:263]: Schalter On! [00:08:36][D][api:573]: Client 'Home Assistant 0.96.5 (192.168.188.30)' connected successfully! [00:08:36][D][time:030]: Synchronized time: Sat Aug 10 00:08:36 2019 [00:08:54][D][text_sensor:015]: 'ESP CO Systemzeit': Sending state '2019-08-10 00:08:54' [00:09:54][D][text_sensor:015]: 'ESP CO Systemzeit': Sending state '2019-08-10 00:09:54' [00:10:16][I][ota:046]: Boot seems successful, resetting boot loop counter. [00:10:54][D][text_sensor:015]: 'ESP CO Systemzeit': Sending state '2019-08-10 00:10:54' [00:11:54][D][text_sensor:015]: 'ESP CO Systemzeit': Sending state '2019-08-10 00:11:54'
I get a similar behavior. My on_time is not respected at all on the device.
time:
- platform: sntp
id: sntp_time
timezone: 'America/New_York'
on_time:
- seconds: 0
minutes: 5
hours: 19
then:
- light.turn_on:
id: h801_2_rgb
Tonight at 4:56 my ESP8266 suddenly decided to turn on/off the onboardLED every 5 seconds. So it seams like a bug in the on_time function, because the time is correct from the start.
4:57 ESP CO Onboard LED turned on 4:57 ESP CO Onboard LED turned off 4:57 ESP CO Onboard LED turned on 4:56 ESP CO Onboard LED turned off 4:56 ESP CO Onboard LED turned on 4:44 ESP CO Systemzeit changed to 2019-08-11 04:44:20 4:29 ESP CO Systemzeit changed to 2019-08-11 04:29:20 4:14 ESP CO Systemzeit changed to 2019-08-11 04:14:20 3:59 ESP CO Systemzeit changed to 2019-08-11 03:59:21
I found that removing sntp and adding HA as time source, my on_time works perfectly. Might be worth a shot if you're still struggling
Ah yes I remember there were some issues with the GPS time code and forgot to push the PR. (I think it was an erronous return type that for some reason wasn't caught by clang-tidy).
EDIT: whoops, commented on wrong issue.
i tried also homeassistant time with the same behavior
@Airfranse
for the connection i use the api. the esp gets the time, thats not the Problem. i see the time in HA and it gets it within the first 1-2 minutes after restart of the esp. but the action starts not
I had similar problem. I set up "manual_ip", and forget to add DNS servers.
I think on this IP there is no dns server [23:52:54][C][wifi:266]: DNS1: 192.168.188.1 [23:52:54][C][wifi:267]: DNS2: 0.0.0.0
@Airfranse
i can't use diffente timezome `time:
i have still Asia/Manila time ` - id: page1 lambda: |- it.strftime(0, 0, id(my_font), "%Y-%m-%d %H:%M", id(sntp_time_fr).now());
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I checked out some things and found the likely cause. In some cases, the time may jump back several hours because the code for time zones is not optimal. The on_time automation code remembers when it was last checked whether something needs to be executed. There is already a solution programmed in if he has missed steps because the processor has been too busy. But there is no checking whether the last check is done in the future. In my case, the time jumps back 8 hours (because the sntp code has gmt+8 by default, who came up with that?), no check is performed for just as long. After 8 hours, the cron tasks start working.
Operating environment/Installation (Hass.io/Docker/pip/etc.): Hass.io
ESP (ESP32/ESP8266, Board/Sonoff): ESP8266
Wemos d1 mini **Affected component: time** https://esphome.io/components/time.html **Description of problem:** First: excuse my bad english. I hope you will unterstand my discription. I have a simple test configuration of my wemos d1 mini, because i have problems with the on_time function in the time component. Sometimes "on_time" works without problems and then suddenly it stopps working, that means, no more execution of actions. in the log of the ESP is no information about an problem,, all other thinks are logged normaly. I use sntp and the time is syncronised, you can see it in the log. During the daytime it works in most cases normal, but without changes in den configuration it sometims stops working. it seams this will happen almost in the evening and it is not possible to get it working during the evneing/night when i upload a new configuration. I have this problem testet on 3 different D1 minis. The Testcode should turn on/off the onboard LED every 5 seconds. **Problem-relevant YAML-configuration entries:** ```yaml time: - platform: sntp id: sntp_time servers: - fritz.box - 128.130.2.3 - time.tugraz.at on_time: - seconds: /5 then: - switch.toggle: onboardLED switch: - platform: gpio name: "ESP CO Onboard LED" id: onboardLED pin: number: D4 inverted: True mode: OUTPUT restore_mode: ALWAYS_OFF on_turn_on: - logger.log: "Schalter On!" on_turn_off: - logger.log: "Schalter Off!" ``` **Logs (if applicable):**Additional information and things you've tried: