I’m trying to accomplish that when i’m not connected to my wifi or any known wifi, it doesn’t show ‘Not_Connected’ but instead says something like ‘5G’.
After some trail and error i’ve accomplished that part, but now it always shows ‘5G’ even when i’m on my home wifi
[[[
var l = states['sensor.iphone_van_maurice_ssid'].state;
if (l = 'not_connected') { l = '5G' }
return `<ha-icon
icon="mdi:wifi-arrow-up-down"
style="width: 40px; height: 20px; vertical-align: 11%; color: deepskyblue;">
</ha-icon><span> <span style="color: var(--text-color-sensor);">${l}</span></span>`
]]]
So what i would like to see is that it always shows the connected wifi, and only when not connected to any wifi it shows 5G
Thanks for the quick reply.
I tied it but this gives me a weird error:
Configuratiefouten ontdekt:
tab characters must not be used in indentation (72:1)
69 | - justify-self: start
70 | custom_fields:
71 | Wifi: |
72 | →[[[
------^
73 | → var ssid = states['sensor.ip ...
74 | var type = states['sensor ...
I also think i might gave some wrong/strange information. Eerly day
The line i added: if (l = 'not_connected') { l = '5G' } makes it a bit weird. Before i added this line, when my phone connected to wifi it just showed the wifi name. Exactly what i wanted. But when i’m on my cellular it shows “not_connected”.
Basicly when i’m not on a known wifi network, so i’m using my 5G, it needs to show that instead of not_connected.
I can’t encounter any hidden characters. Can you delete them? Anyway, the suggested way seems clear, I think.
Maybe stupid question, but have you checked your phone settings twice? Is Apples private mode activated?