@jkandasa Thanks a lot for the example. The delay doesn't matter. I had already found a solution. But I didn't think this was good enough to publish. I take advantage of the fact that the mysensors nodes do not necessarily need a request message for the Ota function. So I got along with mcApi.sensor (). SendPayload ().
When I have time again I'll try your better solution.
Ok,I tested this but couldn't get it to work. Presumably I didn't follow the instructions properly.
When you do changes on HTML additional headers, you have to reload the browser. I hope you did this.
With some work it could be better, so for example, I lose the hover information, I had trouble getting two of these plots on one dashboard with different bins.
For hover information, I do nit get any clue. As I never worked directly with the D3 chart.
For the multiple of charts on same dashboard issue, you might have chart id issue.
Maybe because of this one,
@jkandasa I'm using the 0.0.3.Final-SNAPSHOT - does this mean I dont need to create a script like above but find a rule/condition about battery levels of nodes? If so, I cannot find that, but I am currently using your script example, which works, but is of course a little cumbersome compared to another option of using a node's battery level directly somewhere in the rules panel...
As jkandasa said, you should probably download the last SNAPSHOT version again. Your error message seems to be because you don't have the SNAPSHOT with his modification.
As for the step-by-step i can try to explain the way i did it:
First, i'm using a Raspberry Pi Zero for the controller with an up-to-date Raspbian distro.
I have the last 0.0.3.Final-SNAPSHOT of MyController.org(at least the one from 24 days ago with jkandasa's modification).
I'm using the 2.0.0 version of MySensors (soon to be updated to the last version).
On MyControler.org i created 2 UID tags (sunrize and sunset) which point to 2 dummy sensors (child of a MySensors node).
Then i have the java script which send the sunrize and sunset value to this UID tags:
var myImports = new JavaImporter(java.io, java.lang, java.util);
//Get Sunrise/Sunset details
var locSettings = mcApi.utils().getServerLocationSettings();
//Get sensor variables for sunrise and sunset
var sensorSunRise = mcApi.uidTag().getByUid("sunrize").getSensorVariable();
var sensorSunSet = mcApi.uidTag().getByUid("sunset").getSensorVariable();
//Update timezone offset values (by default gives GMT timestamp values)
//sensorSunRise.value = locSettings.sunriseTime + locSettings.timezoneOffset;
//sensorSunSet.value = locSettings.sunsetTime + locSettings.timezoneOffset;
var dtr = new Date(locSettings.sunriseTime);
sensorSunRise.value = dtr.getHours() + ':' + dtr.getMinutes();
var dts = new Date(locSettings.sunsetTime);
sensorSunSet.value = dts.getHours() + ':' + dts.getMinutes();
//Send/Update thise sensorvariable with updated value
On MyControler.org i created an Operation to execute the java script
and a Timer to start the Operation before Sunrize every day.
For your java script you just need to add an if statement comparing the sunrize and sunset values with the current time, and you should be good.