I want to create a sensor based on another sensor (which I preferable do not want to see in the interface or log book).
Right now i have a sensor “LastActive” that gets updated everytime a sensor sends me something. I would like to have a boolean sensor instead named “Active” which is true if Last active is in the past 30 minutes and false otherwise.
The UI can change the appearance of an entity’s datetime value so I need to see the actual datetime value which is displayed in Developer Tools > States. Go to that web page, find sensor.chinotto_lastactive and report its State value (the value may or may not be identical to what you already posted).
This Template Binary Sensor reports on if the time difference between now and the time reported by sensor.chinotto_lastactive is less than 30 minutes (otherwise it reports off).
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title and a link below your first post that leads to the Solution post. This helps users find answers to similar questions. For more information, refer to guideline 21 in the FAQ.
In some cases, you can use device_class to make the UI display on/off as other values. However, there’s nothing available for device_class that will display on/off as Yes/No. Therefore you will have to change it from a Template Binary Sensor to a Template Sensor.