The only issue I can see off-hand is it that the sensor for weather condition, sensor.peterborough_current_condition, reports it’s state with the “pretty” format “Mostly Cloudy” instead of one of the normal condition names like “partlycloudy”. This shouldn’t cause the issue you’re inquiring about, but it does mean that the template needs to be adjusted. The keys in the dictionary, mapper, need to match the value returned by the entity used in condition.
Copy the configurations for all the state-based sensors, paste it into the Template tool in Developer Tools, then let us know what it returns.
glitch with website my post dis appearted… but i was saying the code i had and edited twice… has an else so if non of them words show then the icon will be number 12
and is there a way its always annoyed me… the weather updates i think like every 10 min but with my poor internet it always goes unaviable… anything to fix that?
so i did a test… i changed things around the names…cuz i needed them to match the names orginally i had for sensor like sensor.today_max … so what i did was i deleted the 4 sensors in the Devices section…
i renamed you see below… and i rebooted fully… when i check the states… it doesnt actually create the sensors…
ah ok… i took out the friendly name… and reboot HA but it didnt create the sensors still all i did above just ## pound them out… and restarted… so still wont make those sensors
must be something just 1 small thing
You need to just delete everything… I think you’ve got stuff that is not properly commented out and it’s causing the file to not be loaded properly or you have unique IDs that aren’t unique…
I added the Environment Canada integration to my instance, pasted the sensor config from my post above, and this is the result:
its finally working yaaaaa… what i ended up doing… was i removed the weather.yaml and rebooted HA and then i checked states… and i seen the sensors were still there and the temp ones from i was making… so i i went to settings devices and entities… and searched for them. and deleted them… and did another reboot… check for sensors just to see if anything… conflicting… and then i put the weather.yaml back… and rebooted… and this time it worked… i guessing something was stuck and wouldnt fix itself… so seems to be working…
what does FWIW mean?
and ya i put back state: as value:template i trying something… i did find if i put it under the weather trigger automation under the sensor… it wouldnt work for me… it but id have to keep it under the - sensor:
If you want it to report 0 even if the source sensor is unavailable or unknown then you can remove the availability. Also, Default() is not a valid filter function. Case matters; the filter is default().
Sorry about that… default() is for undefined values, but when the source sensor returns “unknown” or “unavailable” those values are considered defined. You will need to use a different method. Since this is for a numerical value I would suggest int(0) or float(0)…
ok that works. thanks learn something new everyday… glad you know all this code… you must deal with it every day…
i know i still wanna do i asked a year or 2 ago but i still wanna do it … i wanna make a sensor with multiple attributes. like the weather sensor… but no one ever got back to me… i wanted it it for a mqtt and also for a couple things like a message to a display screen… so message had title font color message but no one ever knew… do you know how that works… not something i wanna work on today… but if you know could point me in the right direction for that
I don’t use MQTT very much, but it’s going to depend on how the MQTT topic and payload are set up and/or where the different data points are coming from. If the values for the sensor’s state and all the attributes all come from MQTT, then use an MQTT sensor otherwise you may need to create multiple sensors.