Sonoff TRVZB code

I’m looking for a TRVZB thing code example. The TRVZB is communication via Zigbee2mqtt.

I can help with that, when I’m home after work I’ll post my config for you.

Thank you Maximo

Here’s one of mine. I hope it helps.

UID: mqtt:topic:mosquitto:222ceba67f
label: Radiator (Bathroom)
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:mosquitto
channels:
  - id: occupied_heating_setpoint
    channelTypeUID: mqtt:number
    label: Setpoint
    description: ""
    configuration:
      commandTopic: zigbee2mqtt/Radiator (Bathroom)/set/occupied_heating_setpoint
      min: 4
      stateTopic: zigbee2mqtt/Radiator (Bathroom)/occupied_heating_setpoint
      max: 35
  - id: battery
    channelTypeUID: mqtt:number
    label: Battery
    description: ""
    configuration:
      stateTopic: zigbee2mqtt/Radiator (Bathroom)/battery
      max: 100
      min: 0

Thank you Maximo. According to the zigbee2mqtt documentation you should use:
stateTopic: zigbee2mqtt/Radiator (Bathroom)**/get/**occupied_heating_setpoint

But this is wrong, it does not work. Your code works well. Thank you.
Nico

Hi Maximo, I added a few more channels, they all work well:
UID: mqtt:topic:MQTTBroker:TRVBZunten
label: TRV Badezimmer unten
thingTypeUID: mqtt:topic
configuration: {}
bridgeUID: mqtt:broker:MQTTBroker
location: Bathroom
channels:

  • id: Mode
    channelTypeUID: mqtt:string
    label: Betriebsmodus
    description: " off, heat, auto"
    configuration:
    allowedStates: off,heat,auto
    commandTopic: zigbee2mqtt/TRVBZunten/set/system_mode
    postCommand: true
    retained: true
    stateTopic: zigbee2mqtt/TRVBZunten/system_mode
  • id: Offset
    channelTypeUID: mqtt:number
    label: Korrekturwert
    description: " -7 … +7 in steps of 0,2"
    configuration:
    stateTopic: zigbee2mqtt/TRVBZunten/set/local_temperature_calibration
  • id: Lock
    channelTypeUID: mqtt:switch
    label: Verriegelung
    description: null
    configuration:
    commandTopic: zigbee2mqtt/TRVBZunten/set/child_lock
    stateTopic: zigbee2mqtt/TRVBZunten/child_lock
    off: UNLOCK
    on: LOCK
  • id: OpenWindow
    channelTypeUID: mqtt:switch
    label: FensterOffen
    description: null
    configuration:
    commandTopic: zigbee2mqtt/TRVBZunten/set/open_window
    stateTopic: zigbee2mqtt/TRVBZunten/get/open_window
    off: OFF
    on: ON
  • id: FrostProtectionTemp
    channelTypeUID: mqtt:number
    label: Frostschutztemperatur
    description: " 4 … 10 in steps 1"
    configuration:
    commandTopic: zigbee2mqtt/TRVBZunten/set/frost_protection_temperature
    min: 4
    stateTopic: zigbee2mqtt/TRVBZunten/frost_protection_temperature
    max: 10
  • id: IsTemperature
    channelTypeUID: mqtt:number
    label: Isttemperatur
    description: null
    configuration:
    stateTopic: zigbee2mqtt/TRVBZunten/local_temperature
  • id: Battery
    channelTypeUID: mqtt:number
    label: Batterie
    description: null
    configuration:
    stateTopic: zigbee2mqtt/TRVBZunten/battery
    retained: true
  • id: SetTemperature
    channelTypeUID: mqtt:number
    label: Solltemperatur
    description: null
    configuration:
    postCommand: true
    retained: true
    unit: °C
    min: 10
    max: 25
    commandTopic: zigbee2mqtt/TRVBZunten/set/occupied_heating_setpoint
    step: 0.5
    stateTopic: zigbee2mqtt/TRVBZunten/occupied_heating_setpoint
  • id: Schedule-Su
    channelTypeUID: mqtt:string
    label: Badezimmer unten Tagesplan-So
    description: null
    configuration:
    commandTopic: zigbee2mqtt/TRVBZunten/set/weekly_schedule-sunday
    postCommand: true
    retained: true
    stateTopic: zigbee2mqtt/TRVBZunten/weekly_schedule-sunday
  • id: Schedule-Mo
    channelTypeUID: mqtt:string
    label: Badezimmer unten Tagesplan-Mo
    description: null
    configuration:
    commandTopic: zigbee2mqtt/TRVBZunten/set/weekly_schedule-monday
    postCommand: true
    retained: true
    stateTopic: zigbee2mqtt/TRVBZunten/weekly_schedule-monday
  • id: Schedule-Tu
    channelTypeUID: mqtt:string
    label: Badezimmer unten Tagesplan-Di
    description: null
    configuration:
    commandTopic: zigbee2mqtt/TRVBZunten/set/weekly_schedule-tuesday
    postCommand: true
    retained: true
    stateTopic: zigbee2mqtt/TRVBZunten/weekly_schedule-tuesday
  • id: Schedule-We
    channelTypeUID: mqtt:string
    label: Badezimmer unten Tagesplan-Mi
    description: null
    configuration:
    commandTopic: zigbee2mqtt/TRVBZunten/set/weekly_schedule-wednesday
    postCommand: true
    retained: true
    stateTopic: zigbee2mqtt/TRVBZunten/weekly_schedule-wednesday
  • id: Schedule-Th
    channelTypeUID: mqtt:string
    label: Badezimmer unten Tagesplan-Do
    description: null
    configuration:
    commandTopic: zigbee2mqtt/TRVBZunten/set/weekly_schedule-thursday
    postCommand: true
    retained: true
    stateTopic: zigbee2mqtt/TRVBZunten/weekly_schedule-thursday
  • id: Schedule-Fr
    channelTypeUID: mqtt:string
    label: Badezimmer unten Tagesplan-Fr
    description: null
    configuration:
    commandTopic: zigbee2mqtt/TRVBZunten/set/weekly_schedule-friday
    postCommand: true
    retained: true
    stateTopic: zigbee2mqtt/TRVBZunten/weekly_schedule-friday
  • id: Schedule-Sa
    channelTypeUID: mqtt:string
    label: Badezimmer unten Tagesplan-Sa
    description: null
    configuration:
    commandTopic: zigbee2mqtt/TRVBZunten/set/weekly_schedule-saturday
    postCommand: true
    retained: true
    stateTopic: zigbee2mqtt/TRVBZunten/weekly_schedule-saturday
1 Like