logo elektroda
logo elektroda
X
logo elektroda

Automating Daylight Savings Adjustments for NTP with Scripting or driver update

randomalias324 2607 60
ADVERTISEMENT
  • #61 21597196
    4N6nerd
    Level 2  
    >>21597185
    OUCH! so sorry! I checked my post with my actual code and it's not '&&' that is missing but ' ' that is missing

    My post says "31-$mday $day<=6" while it should be "31-$mday+$day<=6"

    I'll repair my previous post right away.

    Thanks for the heads-up! "Dankjewel" ;)



    Edit: + signs get removed on initial post. After editting it back it stays. :P
  • ADVERTISEMENT

Topic summary

The discussion centers on automating daylight savings time (DST) adjustments for devices using OpenBeken firmware with NTP time synchronization relayed via TuyaMCU. The default NTP driver lacks built-in DST support, requiring manual offset changes twice yearly. Users explored scripting solutions in autoexec.bat to dynamically adjust the ntp_timeZoneOfs parameter based on date and time conditions, leveraging available logical operators (&&, ||), nested if statements, aliases, and clock events. Examples include scripts for Sydney and CET time zones that calculate DST start and end using weekday and month rules. Advanced users shared custom driver code and pull requests adding DST commands and automatic adjustments with minimal flash overhead. Testing revealed that MQTT connectivity affects device stability, with resets occurring when MQTT is disabled; setting a default WiFi state in TuyaMCU mitigates this. The firmware supports clock events for scheduled actions, and recent updates separate clock functions from NTP for modularity. Various hardware platforms (BL602, LN882H, W600, ESP32 variants, TR6260, RTL87X0C) were tested for NTP and clock event functionality, with XR809 lacking support. Documentation on the scripting language is limited; it supports if statements, aliases, labels, goto, and backlog for multiple commands but lacks general variable support. The community continues to refine DST handling and clock features in OpenBeken firmware to improve usability for time-displaying IoT devices.
Summary generated by the language model.
ADVERTISEMENT