I’ve been experiencing problems caused by humidity in the house. As a result I’ve bought a dehumidifier, which is working well. I’ve also bought a Zigbee Coordinator and added in a humidity sensor. This is now giving regular updates on the humidity and temperature in the room.
I have the dehumidifier plugged into a smart socket, I could just have it turn on at a certain time and off at another, but I’d rather it only came on when the humidity was over 55% and turned off when it was below 50% between the hours of 07:30 and 21:00.
The trend has been that it is over 70% by the morning, in winter, and I can get it below 50% in a couple of hours.
The difficulty that I am experiencing is that the script I’ve put together to run this automation is trying to use a numeric state, but it will not see the reading from the sensor as a number it gives the following error:
Error: In ‘numeric_state’ condition: entity sensor.bedroom_thermometer_humidity state ‘%’ cannot be processed as a number
I don’t know how to work around this. What other kind of trigger can I use to address this? Or is there a way to get this to recognise the readings from the sensor?
As pedolsky mentions remove the attribute.
What you are saying to the automation is to look at the attribute unit_of_measurement which I assume is % and compare that with a number.
If you remove that line it will look at the state which is a string but can be converted to number.
Edit is this a script you made?
I can’t see trigger only sequence.
You should have made it an automation.
Hi all,
Sorry, I’d gone out. I’ll try again with the suggestions above. I do have an automation that runs when the nominated input_boolean is activated, but it won’t activate.
I have tried it without the unit_of_measurement, but when I tried to run a trace on it there was nothing. So I’m just a bit confused as to what it is that I am doing wrong.
I’d originally tried to create an automation that used the same kind of format. If the times were between 07:30 and 21:00 and the humidity was over X amount turn on the plug. It didn’t work. I’d watched some videos saying about using scripts, so I tried it as a script that would trigger the input_boolean, which was probably unnecessary it was mostly so I could see if the script was working.
What I can’t get my head around is that the script won’t read the unit of measurement, because it wants a number, not a percentage, but when I don’t have the unit of measurement included it still doesn’t work. I’ve just set this going:
What I’ve done is give the input Boolean purpose. It will come on overnight, but not turn on the plug. When a certain time is reached if the input Boolean is on then the plug will turn on.