esphome: name: tmpl-clim-publish-all host: api: logger: climate: - platform: template id: test_climate name: Test Publish All Fields optimistic: true # current_temperature/current_humidity/action are only sent over the API at all if their # trait is advertised: current_temperature/current_humidity because a sensor/humidity_sensor # is referenced below, action because supports_action is set. The sensors' fixed readings # match what climate.template.publish pushes, so the sensor callback (guarded to only publish # on an actual change) doesn't produce an extra, unexpected state update of its own. sensor: test_climate_current_temperature humidity_sensor: test_climate_current_humidity supports_action: true supported_modes: - "OFF" - HEAT supported_fan_modes: - AUTO - HIGH supported_swing_modes: - "OFF" - VERTICAL supported_presets: - NONE - ECO on_control: # Should never fire in this test: climate.template.publish is a pure bypass and must not # re-trigger on_control as if the entity were freshly commanded. - logger.log: "on_control fired" sensor: - platform: template id: test_climate_current_temperature name: Test Climate Current Temperature lambda: "return 20.0f;" update_interval: 10ms - platform: template id: test_climate_current_humidity name: Test Climate Current Humidity lambda: "return 60.0f;" update_interval: 10ms button: - platform: template id: publish_all name: Publish All on_press: - climate.template.publish: id: test_climate current_temperature: 20.0 current_humidity: 60.0 target_temperature: 23.0 mode: HEAT action: HEATING fan_mode: HIGH swing_mode: VERTICAL preset: ECO