I’d like to visualise some of my entities as non-interactive switches.
I’ve made some scripts, to know if an integration started successfully or if my various devolo PLC are connected.
It is using MQTT to send the results (i.e.: on/off)
I’d like to see them in an entities card as switches. Which I can of course but then it becomes interactive switches which I don’t want : If my script returns that my “living room” devolo is off, it is off, the user can’t switch it on through HA.
Is there a proper way to configure this?
Thank you.
P.S.: What I’ve done so far : add an input boolean in my configuration.yaml. Display that one, instead of the script result. And in Node-RED, as soon as this input boolean is changing, I put it back to the “real” value returned by the script. But the result is a flickering switch, if you switch it through the interface, Node-RED reset it in a fraction of a second but it is visible.
You can use a picture elements card and make a conditional view.
Say light.somewhere is on then “this” should be displayed.
And “this” can be pretty much anything, icon, text, image.
A switch looks like a circle, slightly wider than a gutter, right.
In the default theme, when off, the circle is white and the gutter is light grey.
If I’m switching to dark mode, the circle is light grey and the gutter is dark grey.
If I’m using the midnight theme (downloaded I can’t remember where), the circle is dark grey and the gutter is black.
If I’m using an image, even with transparency, like the one from mdi toggle-switch-outline, it will stay always the same colors, not like the regular knob.
It will be awful when all the other switches will change their color but not my image.
I mean you can do whatever you want.
Even if the icon of the entity is a knob then you can replace that on the card only to a lightbulb with green color when on and red when it’s off.
Set the condition to the switch ‘on’
Elements is then one icon with lightbulb green.
Condition when switch is ‘off’ , elements, same lightbulb, same position, but red.
This “read only” switch will be in a card with plenty other switches that are “normal”.
From an aesthetic point of view, I’d like all of my entities to look the same.
If it makes me limited and an apple user then I’d say that apple is right on this point even if I’m not an apple user.
If you look inside HA, there are “disabled” switches but I can’t find a way to use such a disabled switch to display my entity state.
I’d say yes and no.
It depends on the label you put in front of the switch.
If you put “kitchen light”, obviously it is a normal switch.
If you put “Vaillant integration successfully started” or “TV’s PLC connected”, it is a factual state that can’t be switched.
Maybe it is counter intuitive for you but for me it makes sense. And at the end, I’m the end-user and “the customer is always right”
However, it is not easy to configure and the lock is not always behaving the right way.
It is not bulletproof either, if you double click to see the history, it will allow you to trigger the switch anyway.
I can’t see the history. So no issue but … well … I’d like to look at the history.
But if I set a pin, then it is prompting for the pin if I tap. And double tap is showing the history but there, it is possible for me to switch, without pin.
The issue with the lock icon is that, sometimes, it is at the start of the row and the icon of the entity is after. Which is ugly. But this is not all the time, I think it is a side effect of the “custom:vertical-stack-in-card” card that I’m using to display those entities.
You’re saying with the above configuration or similar, a double_tap will cause the switch to trigger? Or is with the configuration above with no restrictions? I have to assume it is with no restrictions, as in that case your first tap is unlocking the row and your second tap is a single tap for the row itself. You’d want to tap (to unlock) and once unlocked do your double tap to bring up more-info. If you’re saying double click was bringing up more-info with a PIN set, I’d have to see your configuration and ideally a screen recording.
Also note, that all actions for an entities card’s row is for the the icon/text. The switch is always a switch. You cannot double tap the switch or long hold it to perform other actions. Those are reserved for the icon/text area.
Nevertheless, it is showing the lock between the entity icon and the label (which is fine for me), not on the switch.
For the double tap, indeed, it was not asking for the pin, so you’re probably right, I was frenetically tapping the row to test and that was in fact a unlock + double tap that was triggered. As I was in the history, I was able to switch it on/off. My fault.