I want my temperature sensor to switch my HVAC modes and fan speed

In my garage, I have an HVAC heater and wemos with ESP. SwiCago
There are also some temperature sensors.

I want to turn on my HVAC to heat mode and fan speed 1 when temp is below x
I want to turn on my HVAC to heat mode and fan speed 4 when temp is below y
I want to turn OFF my HVAC when the temp is above z

Wondering why it’s been 3 day with no answer? Ppl here are more than willing to help but you need to show some effort. If you’re interested in NR, I suggest making yourself familiar with the basics.

This is useless, tired of watching videos… Ill try HA automations for this.


This is very basic, next would be a call service. Some people find ha’s system easier.

Took about 5 minutes to put together. Appears to work for me.

[{"id":"78b1760177f4cdec","type":"poll-state","z":"776c027950fc8c3f","name":"Poll Monitoring Temperature","server":"","version":3,"exposeAsEntityConfig":"","updateInterval":"10","updateIntervalType":"num","updateIntervalUnits":"minutes","outputInitially":true,"outputOnChanged":false,"entityId":"sensor.study_aircon_room_temperature","stateType":"num","ifState":"","ifStateType":"str","ifStateOperator":"is","outputs":1,"outputProperties":[{"property":"payload","propertyType":"msg","value":"(\t    $temp:= payload;\t\t    $action:= $temp<15 ? \"full\" : $temp>20 ? \"off\" : \"half\";\t    $switch:= $action=\"off\" ? \"OFF\" : \"ON\";\t    $fan:=    $action=\"full\" ? \"5\" : \"2\";\t    \t    $call_on:={\t        \"domain\": \"climate\",\t        \"service\": \"turn_on\",\t        \"target\": { \"entity_id\": [\"climate.study_aircon\"] },\t        \"data\": {}\t        };\t    \t    $call_off:= $call_on ~> |$|{\"service\": \"turn_off\"}|;\t    $call_fan:= $call_on ~> |$|{\"service\": \"set_fan_mode\", \"data\": {\"fan_mode\": $fan}}|;\t    $call_heat:=$call_on ~> |$|{\"service\": \"set_hvac_mode\", \"data\": {\"hvac_mode\": \"heat\"}}|;\t    \t    $action=\"off\" ? [$call_off] : [$call_on, $call_heat, $call_fan]\t)","valueType":"jsonata"},{"property":"topic","propertyType":"msg","value":"","valueType":"triggerId"}],"x":480,"y":5500,"wires":[["ad41ff614522f5a4"]]},{"id":"ad41ff614522f5a4","type":"split","z":"776c027950fc8c3f","name":"Each","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":690,"y":5500,"wires":[["8aa4507b5fdab447"]]},{"id":"8aa4507b5fdab447","type":"api-call-service","z":"776c027950fc8c3f","name":"Do the stuff (Q)","server":"","version":5,"debugenabled":false,"domain":"","service":"","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"all","x":860,"y":5500,"wires":[[]]}]

You may wish to swap out the Poll node for a Current state node, and of course set your HomeAssistant server, the correct entities, and temperature boundaries.

It took less than a minute to leave as is… Dont understand any of this.

I almost have three rules working.
Only ABOVE triggen does not work when temp is allready above. Only when it comes from below to above

Where is this Edit event?

The event state node

Screenshot 2024-02-05 122928

Take a look at this post as well, should give you an idea of how an automation/flow is put together.

The image is editing the events: state node.

I don’t think you will get people to help you much, if you express zero initiative to learn anything about the tool.

Node Red is very powerful, but has a learning curve. If you don’t want to learn about the platform before complaining, then sticking with HA automations is probably a good choice.

Nobody is going to build your entire flows for you or explain how the entire tool works from top to bottom. If you have specific questions, then you will get help here or on the discord.

I have been sitting and trying to learn all nights, more than 2 weeks… So if you think I’m too stupid for this I don’t care.

Blody chicken, you were egg also.

Nobody said you’re stupid…

If you have a question, ask it. Be specific about what’s not working.

Show the flow you’re working on in an image, and export the flow so others can help you.

Edit: here’s something worth reading: How to help us help you - or How to ask a good question

How can i be specific?

I just dont know where to start.
I can understand is I have a sample similar enough, and also modify it.
Now I have just a mess with everything that don’t work

Specific questions about your issue. Showing what you have so far in the form of an image of your flow and exporting the relevant info. Reading the link I provided about how to be specific.

Where to start: learning about node red basics… such as an informative video.

This is a complex tool. If you were learning to be a pilot, do you think the first step is to hop into a commercial jet and complain it doesn’t work?

Hi, I am new to programming in HA self, but it looks a bit like shorthand for C++

Looking at this post: https://community.home-assistant.io/t/i-want-my-temperature-sensor-to-switch-my-hvac-modes-and-fan-speed/676839/5?u=esphomeplus

    $action:= $temp<15 ? "full" : $temp>20 ? "off" : "half";
    $switch:= $action="off" ? "OFF" : "ON";
    $fan:=    $action="full" ? "5" : "2";

In the first line $temp>20 will switch the unit off and if the temp is below 20 but higher than 15 it will set $action to half->2 (fan).
If the temp is below 15 then $action is set to full->5 (fan)

The two line below assigns the values to correct states.

So temp below 15 set switch=!off->ON, fan=full->5
So temp over 20 set switch=off->OFF, fan=half->2
So temp between 15 and 20 set switch=!off->ON, fan=half->2

Knipsel

The node each in the middle splits the switch and fan controls so that the are transmitted separate.