Create schedule for TRV and send via MQTT

Hi!

I’ve researched this topic a lot, but haven’t found a solution.

I have a bunch of TRVs that are connected to zigbee2mqtt. There are many things that work, but I am looking for something particular. They are this model: Lidl 368308_2010 control via MQTT | Zigbee2MQTT

So, I have been able to create various schedules for them using different scheduler addons and automation. They work, in that they set the TRV modes and temperatures as requested, online.

However, these TRVs also have the option to send an MQTT message with a full weekly schedule. For example, if I send to zigbee2mqtt/Thermostat_Office/set this message:

{
"monday": {
"monday_temp_1": "14",
"monday_hour_1": "00",
"monday_minute_1": "00",
"monday_temp_2": "15",
"monday_hour_2": "02",
"monday_minute_2": "00",
"monday_temp_3": "16",
"monday_hour_3": "03",
"monday_minute_3": "00",
"monday_temp_4": "17",
"monday_hour_4": "04",
"monday_minute_4": "00",
"monday_temp_5": "18",
"monday_hour_5": "05",
"monday_minute_5": "00",
"monday_temp_6": "19",
"monday_hour_6": "06",
"monday_minute_6": "00",
"monday_temp_7": "20",
"monday_hour_7": "07",
"monday_minute_7": "00",
"monday_temp_8": "21",
"monday_hour_8": "08",
"monday_minute_8": "00",
"monday_temp_9": "22",
"monday_hour_9": "09",
"monday_minute_9": "00"
}
}

it will set the schedule for Monday.

I am looking for an option to create and send such a message from HA. Like I said, I have researched this a lot, but so far haven’t found a solution.

I would appreciate any pointers you could give me on this. I expect a complete solution is not available, but even if it is just a direction to follow, I might be able to fill in the blanks. At this point, I don’t know even where to start with this. Or if it’s possible at all, or if I should just try Node-Red. Which I have considered, but the options for creating a dashboard for this under the /ui are not great. In any case, I would prefer a native HA solution if possible.

In which entity (or entities) is all of Monday’s schedule currently stored?

In other words, if I were to create a template, to produce the payload example you posted, where would I get the nine temperature and time values?

Hi and thanks for the reply. Sorry, I should have been more clear with that.

Because, that’s the thing: the schedule doesn’t show in any entity. I just see/set the MQTT topic and payload on the broker with MQTT explorer. And Zigbee2MQTT responds to it

I guess that is the first challenge: how might I create an entity that contains such a schedule, and somehow interacts with MQTT.

To be clear, the TRV has been “seen” by HA with autodiscovery. So that is why I am able to schedule it “online”. But just some of its properties are seen as entities at this point.

I no longer understand how you’re currently controlling the TRVs. Are you using “scheduler addons and automation” to control them or not?

If you are, identify the addons and post the automation.

Sure. This is an example of an automation I did:

 alias: Morning heat
  description: ''
  trigger:
  - platform: time
    at: 06:00:00
  condition: []
  action:
  - device_id: bd9394a20c83f04252e712230ab91ced
    domain: number
    entity_id: number.thermostat_kitchen_zigbee_current_heating_setpoint_auto
    type: set_value
    value: 21.5
  mode: single

I also used the scheduler component:

(more examples in future posts due to forum limitations)

But on MQTT, these z2m devices also have a topic to store their schedule. And that has not been configured as an entity in HA. But, if possible, I would like to do that and then create a UI in a dashboard with which I set the respective values, which are then transmitted by HA in the format that I posted at the beginning.

Hope I made the picture clear now. :slight_smile:

So, the thermostats are configured in HA with SOME of their entities, for example as below.

And also this Simple Scheduler addon:

Anyone? Anything?

Hi! @louisnichols Any luck with this thing? I am using this one: TuYa ZWT198/ZWT100-BH control via MQTT | Zigbee2MQTT also through zigbee2mqtt. It stores schedule as a string like this 06:00/20.0°C 08:00/16.0°C 11:30/16.0°C 12:30/16.0°C 17:00/22.0°C 22:00/16.0°C. I am about to write ton of weird yaml code converting scheduler component settings to this string, but maybe you found better solution

Hi,
I entirely get what you are on about. I have lightwave (old style) devices that work like this, if net or power goes down it doesn’t matter as they store the schedule internally on each TRV. I’m not very impressed with some of the HA basic cards, though.
Anyway, I am NOT (as a new entrant) using MQTT and I wonder if the string can even be sent under HA.
Does anyone know?
Also is your ‘simple scheduler’ available in HA?

Hi! I have the same thermostat.
Have you found a smart way to use something like an UI Scheduler instead of writing down the string?