Okay - I’ll list everything I’ve done - but I don’t see why it’s not working (I’m getting a NULL Value when viewing under classic UI with the sitemap in question) Very simple stuff so far!
{
"link": "http://******:8080/rest/items/zwave_device_dcac0cb6_node2_meter_kwh",
"state": "497.147",
"stateDescription": {
"pattern": "%.1f",
"readOnly": true,
"options": []
},
"type": "NumberItem",
"name": "zwave_device_dcac0cb6_node2_meter_kwh",
"label": "Electric meter (kWh)",
"tags": [],
"groupNames": []
}
I’m testing here - so the Cron is very often - I’ll change it to when the zwave sensor gets updated
I’m also just trying to insert a value as a last ditch effort to get something ANYTHING other than NULL.
import org.openhab.core.library.types.DecimalType
rule "Calculate Monthly Charge"
when
//Item zwave_device_dcac0cb6_node2_meter_kwh.state recieved updated
time cron "5 * * * * ?"
then
//total_cost.postUpdate((zwave_device_dcac0cb6_node2_meter_kwh.state as DecimalType) * .047)
totalCost.postUpdate(500)
end
I’ve bounced back and forth defining the label in sitemap vs Item - I switched at one point, but didn’t make a difference.
sitemap default label="The old Strickland House"{
Frame label="Energy" {
Text item=zwave_device_dcac0cb6_node2_meter_kwh label="KWH"
Text item=zwave_device_dcac0cb6_node2_meter_watts label="Watts" valuecolor=[>5000="red",>2500="orange",<=1000="blue"]
Text item=totalCost label="Total Cost [%f]"
}
}
And last but not least - the one liner of a items list (I’m not sure where OH2 put my nodes for Zwave, I think somewhere in userdata? which is weird, but both other items in the sitemap work.
Number totalCost
Any help is appreciated!
EDIT: - log file contains this.
2016-08-27 10:33:15.326 [ERROR] [.script.engine.ScriptExecutionThread] - Rule 'Calculate Monthly Charge': Script interpreter couldn't be obtain