Initial commit
This commit is contained in:
18
time-based/old/sunset-lights.js
Normal file
18
time-based/old/sunset-lights.js
Normal 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;
|
||||
Reference in New Issue
Block a user