Initial commit

This commit is contained in:
2023-09-28 12:28:27 -04:00
commit 25780c8c5d
30 changed files with 1777 additions and 0 deletions

View File

@ -0,0 +1,11 @@
var daynight = msg.payload
if (daynight === 0) {
node.status({fill:"red",shape:"ring",text:"Off"});
msg.payload = "off"
} else if (daynight === 1) {
node.status({fill:"green",shape:"dot",text:"On"});
msg.payload = "on"
}
return msg;

View File

@ -0,0 +1,20 @@
var states = global.get('homeassistant.homeAssistant.states')
var holidayMode = states['input_boolean.holiday_mode'].state
var holidayHold = states['input_boolean.holiday_mode_hold'].state
var currentHoliday = states['input_select.holiday_animation'].state
var holiday = currentHoliday.toLowerCase()
if (holidayMode === 'on') {
if (holidayHold === 'off') {
node.status({fill:"green",shape:"dot",text:"Holiday On" });
msg.holiday = holiday
return msg;
} else {
node.status({fill:"yellow",shape:"dot",text:"Holiday Hold On"});
msg.holiday = holiday
return msg;
}
} else {
node.status({fill:"red",shape:"ring",text:"Holiday Off"});
return null;
}

View File

@ -0,0 +1,13 @@
var states = global.get('homeassistant.homeAssistant.states')
var holidayMode = states['input_boolean.holiday_mode'].state
var currentHoliday = states['input_select.holiday_animation'].state
var holiday = currentHoliday.toLowerCase()
if (holidayMode === 'on') {
msg.holiday = holiday
node.status({fill:"green",shape:"dot",text:"Holiday On"});
return msg;
} else {
node.status({fill:"red",shape:"ring",text:"Holiday Off"});
return null;
}

View File

@ -0,0 +1,18 @@
var states = global.get('homeassistant.homeAssistant.states')
var sunsetLights = states['input_boolean.sunset_lights_on'].state
var weather = states['weather.iron_nerd_weather_station'].state
if (sunsetLights === 'on') {
if (weather === 'sunny' || weather === 'clear-night') {
node.status({fill:"green",shape:"dot",text:"Nice Weather"});
return[msg,null,null]
} else {
node.status({fill:"grey",shape:"dot",text:"Shitty Weather"});
return[null,msg,null]
}
} else {
node.status({fill:"red",shape:"ring",text:"Disabled"});
return[null,null,msg]
}
return msg;

View File

@ -0,0 +1,26 @@
var tomorrow = msg.tomorrow
var today = msg.today
var number = {}
var work_tomorrow = {}
if (tomorrow > 0) {
work_tomorrow = "true"
if (today == 0) {
number = 0
} else {
number = 1
}
} else {
work_tomorrow = "false"
number = 0
}
msg.work_tomorrow = work_tomorrow
if (number == 0) {
node.status({fill:"green",shape:"dot",text:"Number 0"})
return[msg,null]
} else {
node.status({fill:"green",shape:"dot",text:"Number 1"})
return[null,msg]
}