Skip to content

Update humidifier-flow#3

Open
viper33802 wants to merge 1 commit intoledgardener:masterfrom
viper33802:master
Open

Update humidifier-flow#3
viper33802 wants to merge 1 commit intoledgardener:masterfrom
viper33802:master

Conversation

@viper33802
Copy link
Copy Markdown

@viper33802 viper33802 commented Jan 5, 2021

Converted msg.payload objects to variables in the function. Created 2 new variables for the Humidity on and off percent. Updated the function to output the new values to a third function output everytime the function is ran. Using the third output to report these on/off values back to Home Assistant into an Input_number helper.

var humisensor = msg.payload["sensor.ruuvi_humidity_4x4"];
var humitarget = msg.payload["input_number.humidity_target"];
var humitol = msg.payload["input_number.humidity_tolerance"];
var humion = (humitarget - humitol);
var humioff = (humitarget + humitol);

msg.data.humi = {"humidifier_on":humion, "humidifier_off":humion};

if (humisensor < humion) {
    var msg1={on};
}

else if (humisensor > humioff) {
    var msg2={off};
}
var msg3={};
msg3.payload = msg.data.humi;
return [msg1, msg2, msg3]

image

Converted msg.payload objects to variables in the function. Created 2 new variables for the Humidity on and off percent. Updated the function to output the new values to a third function output everytime the function is ran. Using the third output to report these on/off values back to Home Assistant into an Input_number helper.
@hellresistor
Copy link
Copy Markdown

friend. You have error here no ?

if (humidity < humion)

should be

if (humisensor < humion)

@viper33802
Copy link
Copy Markdown
Author

friend. You have error here no ?

if (humidity < humion)

should be

if (humisensor < humion)

you were correct. I updated the code in my comment above.

@hellresistor
Copy link
Copy Markdown

If u wanna take a look ;) all free
https://github.com/hellresistor/FIFU-Project

@hellresistor
Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants