Goodmorning,
As a NOOB Home Assistant user I do have the following question:
Is it possible to show de duration of an online machine (like an Xbox with the Xbox Addon) in hours:minutes on the Lovelace interface?
I’ve created a binary_sensor for the Xbox Media Player with the following configuration:
I’m not gonna understand it like this. I have no idea what I’m doing, the templating docs are gibberish to me and make my brain explode. I just need the solution which I can then use for reference in similar situations.
And even if I was capable of learning templating, I just find that with the amount of information one seemingly has to understand, it goes against the purpose of home automation which is to save time, at least to me and to a certain part of the community.
Assume your source sensor is created by a “history_stats” integration with “type: time”. Then the sensor has a “device_class: duration”.
Displaying sensors with “device_class: duration” is glitchy in Frontend:
In different cards they may be shown in a different way (issue).
Sensors with same “device_class: duration” in the same Entities card may be shown differently - “history_stats”-sensor is shown as “xx.xx” (as a number), “template”-sensor is shown as “hh:mm:ss” (issue).
So, if you wish to show a “history_stats” sensor in “hh:mm:ss”-like way - your possible options are:
Create a template sensor: take a value of that “history_stats” sensor & convert it to a needed format using templates (to have a nice look everywhere in UI).
Use a custom:template-entity-row (to have a nice look in some particular Entities card).
Update: temporarily removed my template from the post, found an error.
Hours (if uom=hour) must be represented as hh:mm:ss, made a template but it was wrong.
Next try:
What other products did you test before choosing Home Assistant to automate your home?
The reason why I ask is because the challenges you are experiencing suggest
Home Assistant may not be the best choice for your needs and expectations.
Home Assistant requires a significant investment of one’s time and effort to learn its features, functions, and conventions. This is especially true when you venture into creating entities via YAML and making Jinja2 templates (that’s two languages you have to learn).
For example, what you tried here doesn’t even come close to the example in the documentation and has at least four errors.
Incorrect YAML indentation (starting at the third line).
Incorrect configuration format (missing object_id on the third line).
Invalid option (“entity_id”).
Missing quotations (for the sensor’s entity_id in the template’s as_timestamp()).
Although not an error, you chose to define the Template Sensor using the old format (called “legacy” format) instead of the new format (sometimes called “modern” format). My advice is to use modern format (or create a Template Sensor helper) because it will receive enhancements whereas legacy will not.
What other products did you test before choosing Home Assistant to automate your home?
Chinese Wireless Hue bulbs and the Philips Hue Hub. Throughout the years, I’ve read reviews for a lot of automation platforms as I was getting frustrated with HA time and time again but the reviews were contradictory and didn’t inspire much confidence and most enthusiasts recommended HA. At the same time, the community kept saying HA is gonna become less buggy and easier to use over time, so I was thinking, it probably wouldn’t be worth it to completely redo my smart home just for testing something that’s maybe better than HA for me.
I’ve researched Apple Homekit, Samsung Smart Things and Hubitat.
Home Assistant requires a significant investment of one’s time and effort to learn its features, functions, and conventions
Reviews didn’t make the impression it was that messy and complicated and to be honest, I think a platform that a lot of times goes against the, as I think, average consumer’s idea of home automation, which is to save time, should clearly communicate it’s that type of platform upfront.
That’s useful for lighting control (I still use a Philips Hue Hub), meant for consumers, easy to use, but is only a fraction of what “home automation” represents. I wouldn’t classify it as a home automation system.
Apple’s Homekit is targeted for consumers. The other two for consumer/hobbyists (meaning people willing to invest more of their free time to learn and tinker). All three are easier to use than Home Assistant (but not necessarily as capable). I think the best choice for one’s needs strikes a balance between power and ease of use.
I can’t comment on a review I haven’t seen or read but if it didn’t cover templating and YAML-based configuration (what you’re currently having difficulty with) then the review didn’t cover advanced topics.
Here’s a question you should consider: is it any easier to achieve your goals using another product? For example, can you easily display time in a desired format for the equivalent of a History Stats sensor in some other product?
If the answer is that the other product doesn’t even have the equivalent of a History Stats sensor, then you know that your requirements are more advanced than what other products can achieve. Effectively, your requirements exceed what others consider to be typical.
Your home automation goals dictate the tool required to get the job done. If you can’t dedicate time to learn the tool, you either find an easier tool, if it even exists, or scale back your requirements.
FWIW, one the best “reviews” for a product is to observe its community support forum. What kind of difficulties do its users encounter? What are the common questions? The answers to these questions reveal the product’s true strengths and weaknesses.