Home Assistant Sensor Template
The template platform creates switches that combines components.
Home assistant sensor template. Importing attributes is currently not supported but you can create template sensors in home assistant that return the attribute of a sensor and then import the template sensor here. Process incoming data from sources that provide raw data like mqtt rest sensor or the command line sensor. Otherwise the initial state will be undefined. State.
For example if you have a garage door with a toggle switch that operates the motor and a sensor that allows you know whether the door is open or closed you can combine these into a switch that knows whether the garage door is open or closed. To use your mqtt sensor in your installation add the following to your configuration yaml file. Templating in home assistant is powered by the jinja2 templating engine. This means that we are using their syntax and make some custom home assistant variables available to templates during.
If messages in this state topic are published with retain flag the sensor will receive an instant update with last known value. Example configuration yaml entry binary sensor. The template platform supports binary sensors which get their values from other entities. Here is an example of adding a template binary sensor to the configuration yaml file.
The state of a template binary sensor can only be on or off. Sun is up value template. The template platform supports sensors which get their values from other entities. This mqtt sensor platform uses the mqtt message payload as the sensor value.
Adding the following to your configuration yaml file will create two sensors one for the current sun angle and one for the time of the next sunrise. The configuration of template sensors depends on what you want them to be.