Greetings fellow Home Assisted people,
I have an issue trying to use MQTT statestream with a template sensor. I have a sensor (sensor.grid_active_power) and I need to have its negated value published via MQTT.
I created a template sensor:
sensor:
- platform: template
sensors:
grid_power_input:
unique_id: "Huawei_grid_active_power_negated"
friendly_name: "Grid Active Power Import"
unit_of_measurement: "W"
device_class: power
value_template: "{{ states('sensor.grid_active_power') | int * -1}}"
and this seems to work fine.
Then I need to publish this with a bunch of other sensors to MQTT. I used MQTT statestream:
mqtt_statestream:
base_topic: huawei
include:
entities:
- sensor.grid_voltage
- sensor.active_power
- sensor.grid_active_power
- sensor.grid_power_input
- sensor.fq489tx_battery_level
- sensor.fq489tx_battery_autonomy
- sensor.fq489tx_charging_remaining_time
The surprise is that all the native sensors get published but my template sensor is not.
Any idea why?
Kind regards,
Thomas