Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* nilan computations */
- rule "nilan t0-15 sensor division"
- when
- Time cron "0/1 * * * * ?" or
- System started
- then
- heat_nilan?.members.forEach(sourceEl| {
- var Number temp = (sourceEl.state as DecimalType)
- logInfo("nilan_sensor_division", "item " + sourceEl.name.toString + " state=" + sourceEl.state)
- if(temp > 0x8000) {temp = temp - 0xFFFF }
- temp = temp / 100
- logInfo("nilan_sensor_division", "item " + sourceEl.name.toString + " scaled temp=" + temp)
- nilan_aggregated?.members.forEach[targetEl |
- logInfo("nilan_sensor_division", "for loop: " + targetEl.name.toString)
- if(targetEl.name.toString == sourceEl.name.toString + "_div"){
- postUpdate(targetEl, temp)
- } ]
- }
- )
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement