OTGW: how to set outside temperature

I have an OTGW working, and it functions great.

The only thing I would like to do, is send the current outside temperature to the thermostat. The OTGW supports this (I had it when I was running Domoticz), but I just can’t figure out how to send commands to the OTGW from HA.

Does anybody know?

Hi @Hobbybob ,
Did you find a way to set the outside temperarure from HA? If so, would you please share how you did it?

Sadly not. I have searched for options for quite some time, and my conclusion was that apparently I was the only one who wanted something like this.

I managed to set the outside temperature by using the OTGW in MQTT mode and dropped the official OTGW integration. I’m using the latest firmware version from rvdbreemen on my OTGW. I’m currently on v0.10.3+e334c42

OTGW settings:

Make sure:

  • to setup a MQTT broker on the device where you’re running HA. I use Mosquitto as the broker.
  • to enable the MQTT integration in HA.
  • to add the ‘MQTT Auto Discovery prefix’ value to: homeassistant (this will make the device to appear in HA automagically, including the most important sensors. Please note that not all sensors are available in MQTT mode, but this is not an issue for me personally.
  • to set a value the ‘MQTT Uniqueid’ field.
  • that you don’t use MQTT on the OTGW alongside of the official integration, because the can cause unpredictable results.

I created a script in HA to get the current outside temperature from my Meteorologisk institutt (Met.no) integration and publish it to the OTGW:

sequence:
  - variables:
      outsideTemp: |
        {{ state_attr('weather.forecast_home', 'temperature') | float(-273) }}
  - if:
      - condition: template
        value_template: "{{ outsideTemp != -273 }}"
    then:
      - action: mqtt.publish
        metadata: {}
        data:
          evaluate_payload: false
          qos: 0
          retain: false
          topic: OTGW/set/[MQTT Uniqueid]/command
          payload: OT={{ outsideTemp }}
alias: "OTGW: Set Outside Temperature"
description: ""

Replace ‘[MQTT Uniqueid]’ with your unique ID.

I use the script in an automation to publish the outside temperature when the outside temperature changes:

alias: "Heating: Set OTGW Outside Temperature"
description: >-
  Updates the OTGW outside temperature when the current outside temperature
  changes.
triggers:
  - trigger: state
    entity_id:
      - weather.forecast_home
    attribute: temperature
actions:
  - action: script.otgw_set_outside_temperature
    metadata: {}
    data: {}
mode: single

More information about using MQTT with the OTGW firmware can be found here:

It’s also possible to control the OTGW using REST calls if MQTT is not an option: