i’m trying to move my rules from XTent to Node-RED (great tool btw!), one of which reads a value from KNX (got that) and compares it to a stored value from mariaDB/JDBC (using persistence).
This already works so/so in my rule (not OH’s fault, more of a knxd issue), but i can’t seem to find a way to get a historicState into Node-RED.
I tried to find something similar through the REST API, but to no avail - can someone point me in the right direction, or is this not possible at all?
Depending on where the historical data is coming from you could use a global variable in Node-Red to store it when generated. Another option would be to look at the various database nodes available in Node-Red to see f there are any already available for that. Final option would be to switch to a compatible database or write the database calls using a function node.
I think i already saw some ready-made nodes for MariaDB/MySQL, i just had hopes up that openHAB would expose the function calls ready for XTent to the REST API too.
I’m bit uneasy with reinventing something that openHAB already has with layers upon layers of abstraction - starting from installing database drivers (new node-types) to hardcoding database, table names and queries into Node-RED.
You will have to do a bit of parsing on the Node-Red side to extract the value from the returned JSON. But with this REST call you can get all the Historic data you need.