I’m using ZHA but you can check the internal time by querying cluster 0x000a and attribute 0x0000. This value can according to [1] both be read and written. The value stores:
This cluster provides a basic interface to a real-time clock.
The clock time MAY be read and also written, in order to
synchronize the clock (as close as practical) to a time
standard. This time standard is the number of seconds
since 0 hrs 0 mins 0 sec on 1st January 2000 UTC. [1]
I will probably set up an automation script to once daily update the timestamps of the TRVs.
Thanks for the input. I had started myself whit ZHA when I was running the SASWELL devices, then I switched to MQTT because of the vastly superior experience with that device.
I need to figure out how to query the device for time (and potentially set it) using ZIGBEE2MQTT. Any ideas?
zigbee2mqtt/FRIENDLY_NAME/set with payload {"trigger_time": Minutes_since_midnight}
Anyway using Z2M I often have a problem that randomly one or two TRVs stop communicating untill restart Z2M.
Never tryed to set the weekly schedule, does it work with Z2M?
Just tryed, I published
zigbee2mqtt/FRIENDLY_NAME/set with payload {"programming_operation_mode": "setpoint" }
and
zigbee2mqtt/FRIENDLY_NAME/set with payload {"clear_weekly_schedule": 0 }
and
{"weekly_schedule":{"dayofweek":62,"mode":1,"numoftrans":6,"transitions":[{"heatSetpoint":24.5,"transitionTime":0},{"heatSetpoint":25.5,"transitionTime":240},{"heatSetpoint":26.5,"transitionTime":480},{"heatSetpoint":27.5,"transitionTime":720},{"heatSetpoint":28.5,"transitionTime":960},{"heatSetpoint":29.5,"transitionTime":1200}]}}
after that I published
zigbee2mqtt/FRIENDLY_NAME/set with payload {"trigger_time": 240}
and after 1 minute
zigbee2mqtt/FRIENDLY_NAME/set with payload {"trigger_time": 241}
Happy that it is working.
Apparently, all my time synchronization issues are gone (I never encountered them again, even after multiple resets of the devices).
The trigger_time and day_of_week attributes appear to be linked to the “exercise time”:
Cool the weekly schedule is working! I have the same problem that two TRVs stop communicating randomly until HA is restarted. Using ZHA I was actually considering trying Z2M.
Right now I’ve given up on HA and Ally TRVs due to communication dropping but might give it a shot later.
I’m willing to start using the schedule , but I need help in building the payload.
I want to make a specific program for each day of the week.
{
"weekly_schedule": {
"dayofweek":62, #<- decode?
"mode":1, #<- what does it mean? OK, I got it
"numoftrans":6,
"transitions": [
{"heatSetpoint":24.5,"transitionTime":0},
{"heatSetpoint":25.5,"transitionTime":240},
{"heatSetpoint":26.5,"transitionTime":480},
{"heatSetpoint":27.5,"transitionTime":720},
{"heatSetpoint":28.5,"transitionTime":960},
{"heatSetpoint":29.5,"transitionTime":1200}
]
}
}
I’ve looked at Zigbee specs but I could not get to a solution… weekly_schedule should be a list of dicts (like transitions in your example) and each dict filled with the program for the day?
EDIT:
the TRVs do not update trigger_time, so I’m wondering if the schedule could work without updating from outside
after the zigbee specs (look at table 6-37 in the document you reference) dayofweek is a bitmap calculated as follows:
bit 0 weight 1 for Sunday
bit 1 weight 2 for Monday
bit 2 weight 4 for Tuesday
bit 3 weight 8 for Wednesday
bit 4 weight 16 for Thursday
bit 5 weight 32 for Friday
bit 6 weight 64 for Saturday
bit 7 weight 128 for “away” (not supported by Danfoss Ally)
So 62 means all days from Monday to Friday and 65 means Saturday+Sunday
Mode 1 is just “heating” which equals 1.
The transition block has to be stricly increasing with respect to transitionTime
Finally: trigger_time is a parameter, not the current time. I think it is a setup to tell the valve when it has to complete a full cycle (see above)
Thanks for the answer.
I found a way to get the internal clock time:
in the web frontend of zigbee2mqtt, from dev console you can set:
endpoint=1
cluster= genTime
Attribute= time
and push read button.
Anyway, the test schedule doesn’t work anymore with any TRV.
By chance it worked whenI used trigger_time, but as you said trigger_time is a different issue.
Finally, I couldn’t get any result trying to read the weekly_schedule.
I am not able to get it to work. (My Z2M is the current stable that “comes” with HA -
1.22.2 but lists commit as “unknown”).
Never mind… as long as it is working I will leave it there.
Yesterday I went through I kind of nightmare as Z2M began restarting itself with little traces and all my devices disappeared: this morning I have restarted the network and detached momentarily one of the devices that acts as a coordinator and it came back. But yesterday I tried a number of things while offsite and nothing worked…
On your weekly schedule issue: are your clock really synchronized? When I was experimenting, I determined that the schedule was indeed working by using 127 as “dayofweek” and then dissecting the 24 hours with different transition buckets.
Clearly the fact that I cannot read back had an impact.
By the way: what kind of zigbee device are you using? I understood that my Sonoff with EZSP is unstable/limited. Could this be the cause behind my inability to read back from the devices?
I have Z2M in docker so I can update it easily.
My coordinator is this one: Z-Bee Duo
I have the wi-fi version.
Is your sonoff the new stick ?
I’m able to read back just the time, completely unable to read the weekly schedule.
Despite the fact that now my TRVs and Z2M work properly, I’m willing to open an issue or ask Koenkk directly about reading back (time, weekly schedule …).
My Z2M is in a docker too but I don’t know how to upgrade. Can you share a tip?
I am using a sonoff zigbee bridge (SONOFF ZBBridge - Smart Home Zigbee Bridge - SONOFF Official) with a custom Tasmota firmware. I understood that its chipset and the fact that I am basically running a serial over wifi is not the best option. I will look into other options. So… it is not a stick.
Improving support for this TRV would be nice. It appears to be very feature rich (the new version should offer also some adaptive scheduling that would be nice to play with).
I would use the following options: volume: /home/pi/zigbee2mqtt:/app/data replace /home/pi/zigbee2mqtt with your current setup (this is the folder where you have your Z2M configuration.yaml) device: --device=/dev/ttyXXX . Check your current set-up, I can’t tell how your systems handles the ZBBridge. In my set-up, I 've completely removed the device option.
Anyway, it looks like you have a recent version of Z2M.
There is a nice Italian chat on Telegram, look for inDomus.it - Domotica Chat
I’m still a beginner and very-very often I use the guides from the web site indomus.it
Hi, I’m trying to add a schedule to my Popp TRV which is a Danfoss Ally in fact. How to construct the payload for the MQTT message when I want different schedules for the weekend and for working days? Or should I publish these in different messages?
Hi,
Thank you for the example payloads above to set the schedule, it is very helpful !
I am currently testing the solution HomeAssistant + zigbee2mqtt + Sonoff ZBDongle-E (which works fine, after having - painfully - updated the firmware…), as an alternative to my current setup (OpenHAB + Conbee II), mainly in order to support more devices, and wanted to test specifically schedulers in Danfoss Ally before deciding, as I have a number of them.
One question: is there a way to read the values in weekly_schedule , once the thermostat is configured in schedule mode?
I tried sending {“weekly_schedule”:{}} in zigbee2mqtt/myThermostat/get , but it didn’t return anything…and, to be honest, I’m new to zigbee2mqtt and HomeAssistant and not very clear yet on how posting a message in a “get” topic can read any value: where is the response sent? I am using MQTT explorer to do this.
Is there perhaps an easier way to do this? would there be a way to do this directly from HomeAssistant, for example?
Also, just for information: with my current OpenHAB + Conbee II setup, I also regularly have some Danfoss Ally thermostats that stop communicating (after a few weeks/months), and I have to restart them to solve the problem, as some users have mentioned above. So apparently this would not be linked to zigbee2mqtt or to the adapter, but more probably from the device directly (which is a shame, I hoped migrating would solve the problem…). I had upgraded their firmware at the beginning of the year, I still have the same problem.