2 Commits

View File

@ -0,0 +1,43 @@
context.set("isWakeup", false)
const states = global.get('homeassistant.homeAssistant.states')
const dayTemp = parseInt(states['input_number.master_bedroom_daytime_temp'].state)
const nightTemp = parseInt(states['input_number.master_bedroom_night_temp'].state)
const bedTemp = parseInt(states['input_number.master_bedroom_bedtime_temp'].state)
let dayMode = {
"power": "turn_on",
"temp": dayTemp,
"hvac": "cool",
"fan": "auto",
"eco": "turn_on"
}
let nightMode = {
"power": "turn_on",
"temp": nightTemp,
"hvac": "cool",
"fan": "auto",
"eco": "turn_on"
}
let bedMode = {
"power": "turn_on",
"temp": bedTemp,
"hvac": "cool",
"fan": "auto",
"eco": "turn_off"
}
let showerMode = {
"power": "turn_on",
"temp": 70,
"hvac": "dry",
"fan": "auto",
"eco": "turn_off"
}
flow.set('masterBedroom.modes.daymode', dayMode, 'diskCon')
flow.set('masterBedroom.modes.nightmode', nightMode, 'diskCon')
flow.set('masterBedroom.modes.bedmode', bedMode, 'diskCon')
flow.set('masterBedroom.modes.showermode', showerMode, 'diskCon')