@beikeland said:
Works like a charm now! Thanks!!
That’s great! Thank you for the feedback.
Digital Filter for Devices/Variables
"It always takes longer than you expect, even when you take into account Hofstadter's Law.", Hofstadter's Law
</holiday mode>
Just tried to make some filters to use for my esp8266 nodes, implemented as VariablesDevices. But the filter does not like the devices as they lack getTemperature() and getHumidity(). Is this a limitation, or am i just doing it wrong?
"devices": [
{
"id": "esp01",
"name": "Bedroom Temp/esp",
"class": "VariablesDevice",
"variables": [
{
"name": "Temperature",
"expression": "$esp01-tem",
"type": "number",
"unit": "°C"
},
{
"name": "Humidity",
"expression": "$esp01-hum",
"type": "number",
"unit": "%"
},
{
"name": "Uptime",
"expression": "$esp01-upt",
"type": "number"
}
]
},
{
"class": "SimpleMovingAverageFilter",
"id": "esp01-filter",
"name": "Bedroom Temp/esp-Filter1",
"size": 5,
"output": {
"name": "humidity",
"label": "Humidity",
"expression": "$esp01-hum",
"acronym": "H",
"type": "number",
"unit": "%"
}
},
{
"class": "SimpleMovingAverageFilter",
"id": "esp01-filter2",
"name": "Bedroom Temp/esp-Filter2",
"size": 5,
"output": {
"name": "temperature",
"label": "Temperature",
"expression": "$esp01-tem",
"acronym": "T",
"type": "number",
"unit": "°C"
}
}
....
"variables": [
{
"name": "esp01-hum",
"value": 95
},
{
"name": "esp01-upt",
"value": 1834
},
{
"name": "esp01-tem",
"value": 17
},
and the associated log output:
21:14:58.843 [pimatic] info: New device "Bedroom Temp/esp-Filter1"...
21:14:58.862 [pimatic] error: Error loading device esp01-filter: Method getTemperature of Bedroom Temp/esp-Filter1 does not exist!
21:14:59.064 [pimatic] info: New device "Bedroom Temp/esp-Filter2"...
21:14:59.076 [pimatic] error: Error loading device esp01-filter2: Method getHumidity of Bedroom Temp/esp-Filter2 does not exist!
21:15:00.629 [pimatic] info: New device "System"...
change your expression to $device.attribute so maybe this expression will work $esp01-tem.value
pimatic v0.9 has been released!
Support Pimatic and get some free stickers
Like us on Facebook
make it so !
Didn’t seem to have any effect. Although, I’ve “cheated” and implemented a filter in the ESP8266 sensor node.