I'm planning on controlling my water heater depending on current electrical price.
I have a plugin that adds the hourly rates every night. They are stored in a device (IDX) for every hour (24 in total).
My thought was that heater should be active the six lowest hours every 24 hour.
I'm thinking that this should be doable with dzVents but I dont' know where to start.
I want the script to check all these 24 IDX every day, pick out the six lowest values and when these hours are, then activate a switch.
I'm not completely new to scripting but I've never written any dzVent/Lua scripts before.
Is there anyone that could point me in the right direction or give me an example where to start?
