Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
5440325aaf
|
|||
|
4aa305c9d2
|
|||
|
f63baaef48
|
14
climate/emma-bedroom/outdoor-threshold.js
Normal file
14
climate/emma-bedroom/outdoor-threshold.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const outdoor = global.get("outdoorTemp.tempInt")
|
||||
const thresholdEntity = global.get("homeassistant.homeAssistant.states['input_number.emma_bedroom_aircon_mode_threshold'].state")
|
||||
const threshold = parseInt(thresholdEntity)
|
||||
|
||||
msg.outdoor = outdoor
|
||||
msg.modeThreshold = threshold
|
||||
|
||||
if (outdoor >= threshold) {
|
||||
node.status({fill:"green",shape:"dot",text:`${outdoor} >= ${threshold}`})
|
||||
return msg
|
||||
} else {
|
||||
node.status({fill:"red",shape:"ring",text:`${outdoor} < ${threshold}`})
|
||||
return null
|
||||
}
|
||||
14
climate/master-bedroom/outdoor-threshold.js
Normal file
14
climate/master-bedroom/outdoor-threshold.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const outdoor = global.get("outdoorTemp.tempInt")
|
||||
const thresholdEntity = global.get("homeassistant.homeAssistant.states['input_number.master_bedroom_aircon_mode_threshold'].state")
|
||||
const threshold = parseInt(thresholdEntity)
|
||||
|
||||
msg.outdoor = outdoor
|
||||
msg.modeThreshold = threshold
|
||||
|
||||
if (outdoor >= threshold) {
|
||||
node.status({fill:"green",shape:"dot",text:`${outdoor} >= ${threshold}`})
|
||||
return msg
|
||||
} else {
|
||||
node.status({fill:"red",shape:"ring",text:`${outdoor} < ${threshold}`})
|
||||
return null
|
||||
}
|
||||
@@ -348,7 +348,7 @@ if (type === 'auto' && time != 'bedtime') {
|
||||
}
|
||||
|
||||
// Automated responses
|
||||
if (type === 'auto' && allowed === 'on' && meltdown === 'off' && vacation === 'off') {
|
||||
if (type === 'auto' && allowed === 'on' && meltdown === 'off' && vacation === 'off') { //! allowed === 'off' currently because of upstairs heat issues. Need to figure out a way to still allow wakeup flow to run.
|
||||
node.log("Master Bedroom Climate: Auto")
|
||||
if (sleeping === 'on' && topic != 'mrbedroom-wakeup') {
|
||||
node.status({ fill: "red", shape: "ring", text: "Blocked (sleep mode)" })
|
||||
|
||||
@@ -5,7 +5,8 @@ const lux = parseInt(states['sensor.master_bedroom_illuminance'].state)
|
||||
const threshold = parseInt(states['input_number.master_bedroom_lux_threshold'].state)
|
||||
const masterBedroomSleep = states['input_boolean.master_bedroom_sleeping'].state
|
||||
const kallenBedroomSleep = states['input_boolean.kallen_sleeping'].state
|
||||
const peopleSleeping = (masterBedroomSleep === 'on' || kallenBedroomSleep === 'on')
|
||||
const emmaBedroomSleep = states['input_boolean.emma_sleeping'].state
|
||||
const peopleSleeping = (masterBedroomSleep === 'on' || kallenBedroomSleep === 'on' || emmaBedroomSleep === 'on')
|
||||
const nightMode = states['input_boolean.night_mode'].state
|
||||
const payload = msg.payload
|
||||
const newDuration = duration * 60
|
||||
|
||||
@@ -2,11 +2,17 @@ const states = global.get('homeassistant.homeAssistant.states')
|
||||
const lights = states['light.upstairs_bathroom_lights'].state
|
||||
const duration = states['input_number.upstairs_bathroom_motion_off_delay'].state
|
||||
const lux = parseInt(states['sensor.upstairs_bathroom_illuminance'].state)
|
||||
const threshold = parseInt(states['input_number.upstairs_bathroom_lux_threshold'].state)
|
||||
const showerMode = states['input_boolean.shower_mode'].state
|
||||
const emmaBedroomSleep = states['input_boolean.emma_sleeping'].state
|
||||
const payload = msg.payload
|
||||
const newDuration = duration * 60
|
||||
|
||||
let threshold = parseInt(states['input_number.upstairs_bathroom_lux_threshold'].state)
|
||||
|
||||
if (emmaBedroomSleep === 'on') {
|
||||
threshold = 10
|
||||
}
|
||||
|
||||
let timerCancel = {
|
||||
"payload": "stop"
|
||||
}
|
||||
@@ -32,11 +38,11 @@ if (showerMode === 'off') {
|
||||
}
|
||||
|
||||
node.log("----- Upstairs Bathroom Motion Parameters Start -----")
|
||||
node.log("Upstairs Bathroom payload: " + payload)
|
||||
node.log("Upstairs Bathroom lights: " + lights)
|
||||
node.log("Upstairs Bathroom duration: " + duration)
|
||||
node.log("Upstairs Bathroom newDuration: " + newDuration)
|
||||
node.log("Upstairs Bathroom lux: " + lux)
|
||||
node.log("Upstairs Bathroom threshold: " + threshold)
|
||||
node.log("Upstairs Bathroom showerMode: " + showerMode)
|
||||
node.log(`Upstairs Bathroom payload: ${payload}`)
|
||||
node.log(`Upstairs Bathroom lights: ${lights}`)
|
||||
node.log(`Upstairs Bathroom duration: ${duration}`)
|
||||
node.log(`Upstairs Bathroom newDuration: ${newDuration}`)
|
||||
node.log(`Upstairs Bathroom lux: ${lux}`)
|
||||
node.log(`Upstairs Bathroom threshold: ${threshold}`)
|
||||
node.log(`Upstairs Bathroom showerMode: ${showerMode}`)
|
||||
node.log("----- Upstairs Bathroom Motion Parameters End -----")
|
||||
Reference in New Issue
Block a user