Created
December 12, 2024 22:50
-
-
Save trexx/dd934ed805730c0955297c319ad78850 to your computer and use it in GitHub Desktop.
Setting datetime on POPP / Danfoss Ally zigbee TRVs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| alias: Set Time On TRVs | |
| description: "" | |
| triggers: | |
| - trigger: time_pattern | |
| hours: "6" | |
| minutes: "0" | |
| seconds: "0" | |
| conditions: | |
| - condition: time | |
| weekday: | |
| - thu | |
| actions: | |
| - repeat: | |
| sequence: | |
| - action: mqtt.publish | |
| metadata: {} | |
| data: | |
| topic: zigbee2mqtt/{{ repeat.item }}/1/set | |
| payload: |- | |
| {"write":{"cluster":"genTime","options":{},"payload":{ | |
| "time":{{ (utcnow().timestamp()-as_timestamp('2000-01-01T00:00:00'))|int }}, | |
| "timeStatus":1, | |
| "timeZone":{{now().utcoffset().total_seconds()|int}}, | |
| "dstStart":{{ (as_timestamp(states('sensor.daylight_savings_start'))-as_timestamp('2000-01-01T00:00:00'))|int }}, | |
| "dstEnd":{{ (as_timestamp(states('sensor.daylight_savings_end'))-as_timestamp('2000-01-01T00:00:00'))|int }}, | |
| "dstShift":{{ states('sensor.daylight_savings_offset')|int }} | |
| }}} | |
| for_each: | |
| - Office TRV | |
| - Basement TRV | |
| mode: single |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rest: | |
| - resource_template: "https://www.timeapi.io/api/timezone/zone?timeZone={{ now().tzinfo }}" | |
| scan_interval: 86400 | |
| sensor: | |
| - name: "Daylight Savings: Start" | |
| value_template: > | |
| {{ value_json.dstInterval.dstStart | as_datetime }} | |
| device_class: timestamp | |
| - name: "Daylight Savings: End" | |
| value_template: > | |
| {{ value_json.dstInterval.dstEnd | as_datetime }} | |
| device_class: timestamp | |
| - name: "Daylight Savings: Offset" | |
| value_template: > | |
| {{ value_json.dstInterval.dstOffsetToStandardTime.seconds | int }} | |
| unit_of_measurement: seconds |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Not needed anymore since Zigbee2MQTT has timesetting functionality built in.