Solved: Node Red, how do I filter out "Unknown"?

Hi I have automated my exterior shades to open in the morning in tilt mode to reduce the morning sun; the automation checks the Darksky cloud-cover sensor every 15 minutes and if the value is <=75% the blinds stay closed. This morning the blinds fully opened even when there wasn’t a cloud in the sky and closed again 15 minutes later. When I look at my HA history, there appears to be a small gap in data for cloud cover at this time, looking at the HA logbook, Darksky changes to “unknown”, this unknown value appears to satisfy the <= criteria and triggers the automation.

a very simplified version of the flow is like this:
time > sun azimuth > cloud cover > open/close

Is there a way of filtering out “unknown”?
I was assuming that no data would equal zero but that doesn’t seem to be the case.

I’m new to NR so any help is welcome.

Thanks

How about doing an export of the node-red code and pasting it in? Hard to troubleshoot your flow when I cant see it.

usually no data would be null

I put a debug on the output,

msg.payload : string[7]

“unknown”

put a switch node after the cloud cover check, and tell it to send “unknown” to a second output and don’t wire it to anything

Here"s an export of the flow:

[{"id":"86b518d2.f28c68","type":"sun-position","z":"9b57b7dd.b7eba","name":"","positionConfig":"3af7eead.b31292","rules":[{"valueLow":"60","valueLowType":"num","valueHigh":"148","valueHighType":"num"},{"valueLow":"148","valueLowType":"num","valueHigh":"260","valueHighType":"num"}],"onlyOnChange":"true","topic":"","outputs":3,"start":"","startType":"none","startOffset":0,"startOffsetType":"none","startOffsetMultiplier":60000,"end":"","endType":"none","endOffset":0,"endOffsetType":"none","endOffsetMultiplier":60000,"x":468.75,"y":294.2500305175781,"wires":[[],["c2a9589b.5ab16","61a33a75.284354","f87d2a98.40b31"],["903cba92.ebaf78","71ef9a3f.2d29cc","b12b8705.92346"]]},{"id":"d37b5349.a8f1e","type":"api-current-state","z":"9b57b7dd.b7eba","name":"Home/Away","server":"9fb50fc4.9bef78","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.home_away","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":128.5,"y":205,"wires":[[],["4caeb769.61f53"]]},{"id":"c2a9589b.5ab16","type":"api-current-state","z":"9b57b7dd.b7eba","name":"Cloud cover","server":"9fb50fc4.9bef78","outputs":2,"halt_if":"75","halt_if_type":"num","halt_if_compare":"gte","override_topic":false,"entity_id":"sensor.dark_sky_cloud_coverage","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":558.7500610351562,"y":84.25,"wires":[["4bca2ade.fec7d4"],["903cba92.ebaf78"]]},{"id":"d291e836.f8e658","type":"api-call-service","z":"9b57b7dd.b7eba","name":"Side Closed","server":"9fb50fc4.9bef78","service_domain":"scene","service":"turn_on","data":"{\"entity_id\":\"scene.side_closed\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1023.2500610351562,"y":58.25,"wires":[[]]},{"id":"4bca2ade.fec7d4","type":"api-call-service","z":"9b57b7dd.b7eba","name":"Side Venetian","server":"9fb50fc4.9bef78","service_domain":"scene","service":"turn_on","data":"{\"entity_id\":\"scene.side_venetian\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1025.2500610351562,"y":103.75,"wires":[[]]},{"id":"903cba92.ebaf78","type":"api-call-service","z":"9b57b7dd.b7eba","name":"Side Open","server":"9fb50fc4.9bef78","service_domain":"scene","service":"turn_on","data":"{\"entity_id\":\"scene.side_open\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1025.2500610351562,"y":150.75,"wires":[[]]},{"id":"f87d2a98.40b31","type":"api-current-state","z":"9b57b7dd.b7eba","name":"Guest?","server":"9fb50fc4.9bef78","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.guest_mode","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":682.7500610351562,"y":598.75,"wires":[[],["5d405737.1033b"]]},{"id":"b12b8705.92346","type":"api-current-state","z":"9b57b7dd.b7eba","name":"Cloud cover","server":"9fb50fc4.9bef78","outputs":2,"halt_if":"75","halt_if_type":"num","halt_if_compare":"gte","override_topic":false,"entity_id":"sensor.dark_sky_cloud_coverage","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":723.7500610351562,"y":418.75,"wires":[["84a38262.e35b4"],["28d31035.80876"]]},{"id":"8dadde44.412fa8","type":"api-call-service","z":"9b57b7dd.b7eba","name":"Salon 1 Closed","server":"9fb50fc4.9bef78","service_domain":"scene","service":"turn_on","data":"{\"entity_id\":\"scene.poolside_closed\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1028.2500610351562,"y":237.75,"wires":[[]]},{"id":"61a33a75.284354","type":"api-call-service","z":"9b57b7dd.b7eba","name":"Salon 1 Venetian","server":"9fb50fc4.9bef78","service_domain":"scene","service":"turn_on","data":"{\"entity_id\":\"scene.poolside_venetian\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1030.2500610351562,"y":287.25,"wires":[[]]},{"id":"ef033a48.01f048","type":"api-call-service","z":"9b57b7dd.b7eba","name":"Salon 1 Open","server":"9fb50fc4.9bef78","service_domain":"scene","service":"turn_on","data":"{\"entity_id\":\"scene.poolside_open\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1033.2500610351562,"y":354.25,"wires":[[]]},{"id":"522fffd0.7d1ff8","type":"api-call-service","z":"9b57b7dd.b7eba","name":"Red Bed Closed","server":"9fb50fc4.9bef78","service_domain":"scene","service":"turn_on","data":"{\"entity_id\":\"scene.chambre_fermee\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1025.2500610351562,"y":536.75,"wires":[[]]},{"id":"871114ed.454e78","type":"api-call-service","z":"9b57b7dd.b7eba","name":"Red Bed Venetian","server":"9fb50fc4.9bef78","service_domain":"scene","service":"turn_on","data":"{\"entity_id\":\"scene.chambre_my\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1021.2500610351562,"y":591.25,"wires":[[]]},{"id":"5d405737.1033b","type":"api-call-service","z":"9b57b7dd.b7eba","name":"Red Bed Open","server":"9fb50fc4.9bef78","service_domain":"scene","service":"turn_on","data":"{\"entity_id\":\"scene.chambre_ouverte\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1025.2500610351562,"y":645.25,"wires":[[]]},{"id":"4caeb769.61f53","type":"time-range-switch","z":"9b57b7dd.b7eba","name":"Day/Night","lat":"44.1234","lon":"6.2345","startTime":"06:45","endTime":"sunset","startOffset":0,"endOffset":"+1","x":145.25,"y":260.5,"wires":[["86b518d2.f28c68"],["d291e836.f8e658","8dadde44.412fa8","44b402a7.d25914"]]},{"id":"6a26de65.6e203","type":"inject","z":"9b57b7dd.b7eba","name":"","topic":"","payload":"","payloadType":"date","repeat":"900","crontab":"","once":false,"onceDelay":0.1,"x":95.75,"y":63,"wires":[["b8417c1d.760f4"]]},{"id":"71ef9a3f.2d29cc","type":"api-current-state","z":"9b57b7dd.b7eba","name":"Cloud cover","server":"9fb50fc4.9bef78","outputs":2,"halt_if":"75","halt_if_type":"num","halt_if_compare":"gte","override_topic":false,"entity_id":"sensor.dark_sky_cloud_coverage","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":766.5000610351562,"y":329.5,"wires":[["61a33a75.284354"],["61a33a75.284354"]]},{"id":"b8417c1d.760f4","type":"api-current-state","z":"9b57b7dd.b7eba","name":"BSO Auto on?","server":"9fb50fc4.9bef78","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.auto_bso","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":127,"y":141.74998474121094,"wires":[[],["d37b5349.a8f1e"]]},{"id":"28d31035.80876","type":"api-current-state","z":"9b57b7dd.b7eba","name":"Guest?","server":"9fb50fc4.9bef78","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.guest_mode","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":680.7500610351562,"y":502.75,"wires":[[],["5d405737.1033b"]]},{"id":"84a38262.e35b4","type":"api-current-state","z":"9b57b7dd.b7eba","name":"Guest?","server":"9fb50fc4.9bef78","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.guest_mode","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":682.7500610351562,"y":551.75,"wires":[[],["871114ed.454e78"]]},{"id":"44b402a7.d25914","type":"api-current-state","z":"9b57b7dd.b7eba","name":"Guest?","server":"9fb50fc4.9bef78","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.guest_mode","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":679.7500610351562,"y":652.75,"wires":[[],["522fffd0.7d1ff8"]]},{"id":"8f6ec1ac.cde5b8","type":"api-call-service","z":"9b57b7dd.b7eba","name":"Kitchen Venetian","server":"9fb50fc4.9bef78","service_domain":"scene","service":"turn_on","data":"{\"entity_id\":\"scene.cuisine_venetian\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1024.75,"y":716.75,"wires":[[]]},{"id":"b8059319.7d27c8","type":"api-current-state","z":"9b57b7dd.b7eba","name":"Home/Away","server":"9fb50fc4.9bef78","outputs":2,"halt_if":"off","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.home_away","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":691.25,"y":722.5,"wires":[["8f6ec1ac.cde5b8"],["416bb57a.2414e4"]]},{"id":"c0309509.354438","type":"api-current-state","z":"9b57b7dd.b7eba","name":"BSO Auto on?","server":"9fb50fc4.9bef78","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"input_boolean.auto_bso","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","x":422.25006103515625,"y":723,"wires":[[],["b8059319.7d27c8"]]},{"id":"78123c79.d80054","type":"time-inject","z":"9b57b7dd.b7eba","name":"","positionConfig":"3af7eead.b31292","payload":"on","payloadType":"str","payloadTimeFormat":0,"payloadOffset":0,"payloadOffsetType":"none","payloadOffsetMultiplier":60000,"topic":"","time":"06:45","timeType":"entered","timeDays":"*","offset":0,"offsetType":"none","offsetMultiplier":60000,"property":"","propertyType":"none","propertyCompare":"true","propertyThreshold":"","propertyThresholdType":"num","timeAlt":"","timeAltType":"entered","timeAltOffset":0,"timeAltOffsetType":"none","timeAltOffsetMultiplier":60000,"once":false,"onceDelay":0.1,"addPayload1":"","addPayload1Type":"none","addPayload1Value":"","addPayload1ValueType":"date","addPayload1Format":"0","addPayload1Offset":0,"addPayload1OffsetType":"none","addPayload1OffsetMultiplier":60000,"addPayload1Days":"*","addPayload2":"","addPayload2Type":"none","addPayload2Value":"","addPayload2ValueType":"date","addPayload2Format":"0","addPayload2Offset":0,"addPayload2OffsetType":"none","addPayload2OffsetMultiplier":60000,"addPayload2Days":"*","addPayload3":"","addPayload3Type":"none","addPayload3Value":"","addPayload3ValueType":"date","addPayload3Format":"0","addPayload3Offset":0,"addPayload3OffsetType":"none","addPayload3OffsetMultiplier":60000,"addPayload3Days":"*","recalcTime":2,"x":182.5,"y":718.75,"wires":[["c0309509.354438"]]},{"id":"416bb57a.2414e4","type":"api-call-service","z":"9b57b7dd.b7eba","name":"Kitchen Venetian","server":"9fb50fc4.9bef78","service_domain":"scene","service":"turn_on","data":"{\"entity_id\":\"scene.cuisine_open\"}","mergecontext":"","output_location":"","output_location_type":"none","x":1031,"y":779,"wires":[[]]},{"id":"3af7eead.b31292","type":"position-config","z":"","name":"","isValide":"true","longitude":"0","latitude":"0","angleType":"deg","timeZoneOffset":99,"stateTimeFormat":"3","stateDateFormat":"12"},{"id":"9fb50fc4.9bef78","type":"server","z":"","name":"Home Assistant","legacy":false,"hassio":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

OK, that sounds like a good solution, I’ll give it a try, thanks!

In the end I changed my criterion to =>75 and since then I’ve had no problems, perhaps there have been no “unknown” incidents since then. The switch node option looks like a great way to throw away junk data, I’m sure it’ll come in handy in the future. Many thanks to everyone who helped.