I need help for adding months without output

Below is what I am using now for heater automation, simple logic, current temp minus set temp to control on and off. It works great.

But I want to add months, I need it to work only between May-October!

How can it be done please?

[{"id":"a5933c1e60180359","type":"function","z":"858567b07dfcf3a2","name":"","func":"msg.payload = Number(msg.payload[\"sensor.anna_temperature\"]) - Number(msg.payload[\"input_number.anna\"]);\nmsg.topic = \"Number\";\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":390,"y":460,"wires":[["3c45c86928d3e7db"]]},{"id":"3c45c86928d3e7db","type":"switch","z":"858567b07dfcf3a2","name":"","property":"payload","propertyType":"msg","rules":[{"t":"gte","v":"1","vt":"str"},{"t":"lte","v":"0","vt":"str"}],"checkall":"true","repair":false,"outputs":2,"x":510,"y":460,"wires":[["e226848a15ce39db"],["60c1d47bb7d78592"]]},{"id":"e226848a15ce39db","type":"api-call-service","z":"858567b07dfcf3a2","name":"","server":"cf2b698a.f39a18","version":5,"debugenabled":false,"domain":"climate","service":"turn_off","areaId":[],"deviceId":[],"entityId":["climate.zone_3"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":660,"y":420,"wires":[[]]},{"id":"9492ee87b083427a","type":"poll-state","z":"858567b07dfcf3a2","name":"anna Current Temp","server":"cf2b698a.f39a18","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"3","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":false,"entity_id":"sensor.anna_temperature","state_type":"num","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":90,"y":500,"wires":[["a1e7bea13debc685"]]},{"id":"60c1d47bb7d78592","type":"api-call-service","z":"858567b07dfcf3a2","name":"","server":"cf2b698a.f39a18","version":5,"debugenabled":false,"domain":"climate","service":"turn_on","areaId":[],"deviceId":[],"entityId":["climate.zone_3"],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":660,"y":480,"wires":[[]]},{"id":"712a7c14d3e45488","type":"poll-state","z":"858567b07dfcf3a2","name":"anna setup Temp","server":"cf2b698a.f39a18","version":2,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"updateinterval":"3","updateIntervalType":"num","updateIntervalUnits":"seconds","outputinitially":false,"outputonchanged":false,"entity_id":"input_number.anna","state_type":"num","halt_if":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"x":80,"y":440,"wires":[["a1e7bea13debc685"]]},{"id":"a1e7bea13debc685","type":"join","z":"858567b07dfcf3a2","name":"","mode":"custom","build":"object","property":"payload","propertyType":"msg","key":"topic","joiner":"\\n","joinerType":"str","accumulate":false,"timeout":"","count":"2","reduceRight":false,"reduceExp":"","reduceInit":"","reduceInitType":"","reduceFixup":"","x":250,"y":460,"wires":[["a5933c1e60180359"]]},{"id":"cf2b698a.f39a18","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]

Use the following switch node to filter the current date/months and place it behind your join node:

[
    {
        "id": "011bd8884555086b",
        "type": "switch",
        "z": "a442b54b44edc349",
        "name": "",
        "property": "$number($moment().format('M'))",
        "propertyType": "jsonata",
        "rules": [
            {
                "t": "btwn",
                "v": "5",
                "vt": "num",
                "v2": "10",
                "v2t": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 770,
        "y": 820,
        "wires": [
            []
        ]
    }
]

If you need it the other way round then you can use the following switch node:

[
    {
        "id": "011bd8884555086b",
        "type": "switch",
        "z": "a442b54b44edc349",
        "name": "",
        "property": "$number($moment().format('M')) < 5 or $number($moment().format('M')) > 9",
        "propertyType": "jsonata",
        "rules": [
            {
                "t": "true"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 790,
        "y": 820,
        "wires": [
            [
                "e64dd1cd0f7d4d7e"
            ]
        ]
    }
]

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.