Noob question: Timeswitch node configuration validation

[Noob disclaimer: I've poked around a little bit and it looks like this is the best place to raise this, but please feel free to point me in the right direction if not.]

I have a question specifically about the node-red-node-timeswitch node.

I just had some trouble getting my first timeswitch node set up. I have it configured to go off at set times, and it was functioning fine, but every time I went to deploy I was being prompted with a dialog warning that the node was incorrectly configured.

I ended up digging into the JSON to figure out that the deployment process was checking to ensure that my switch had lat/long fields populated, even though 1) it seems to me that it shouldn't require them for a time-based trigger, and 2) the GUI hides those fields when I change the Time options to specific times instead of Dawn/Dusk.

Is this expected behavior? A known issue? Am I doing this entirely wrong and my assumptions are incorrect? Since I haven't found any other chatter about what would otherwise seem an obvious issue, I assume it's PEBCAK.

Thanks!

@knolleary @dceejay hope you guys don't mind the ping, as the listed node maintainers. :slight_smile:

The relevant node, if it's helpful.

  {
    "id": "55247bbe.459584",
    "type": "timeswitch",
    "z": "4aa87067.de46f",
    "name": "",
    "mytopic": "",
    "lat": "",
    "lon": "",
    "starttime": "5000",
    "endtime": "780",
    "duskoff": "0",
    "dawnoff": "0",
    "sun": true,
    "mon": true,
    "tue": true,
    "wed": true,
    "thu": true,
    "fri": true,
    "sat": true,
    "jan": true,
    "feb": true,
    "mar": true,
    "apr": true,
    "may": true,
    "jun": true,
    "jul": true,
    "aug": true,
    "sep": true,
    "oct": true,
    "nov": true,
    "dec": true,
    "x": 370,
    "y": 1640,
    "wires": [[]]
  }

@ardaedhel Welcome to the forum!

could you please provide an export of your flow so I could see the settings in the node. I haven't been able to duplicate your situation.

Also what version of node-red, node.js are you on (you can get this from the start up log)

In order to make code more readable and importable it is important to surround your code with three backticks
```
like this
```
See this post for more details - How to share code or flow json

Hey, thanks for the response!

Versions:
Node-RED version: v1.3.5
Node.js version: v12.22.1

Export:
Did you want the full flows_*.json export?

[
    {
        "id": "4aa87067.de46f",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": ""
    },
    {
        "id": "6f9d4c6c.641914",
        "type": "server",
        "name": "Home Assistant",
        "legacy": false,
        "addon": false,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true
    },
    {
        "id": "b2a9c78b.f01028",
        "type": "debug",
        "z": "4aa87067.de46f",
        "name": "Debug me",
        "active": false,
        "tosidebar": true,
        "console": false,
        "tostatus": false,
        "complete": "true",
        "targetType": "full",
        "statusVal": "",
        "statusType": "auto",
        "x": 950,
        "y": 60,
        "wires": []
    },
    {
        "id": "bc57180a.149778",
        "type": "api-call-service",
        "z": "4aa87067.de46f",
        "name": "Dim Office",
        "server": "6f9d4c6c.641914",
        "version": 1,
        "debugenabled": false,
        "service_domain": "input_number",
        "service": "set_value",
        "entityId": "input_number.brightness_office",
        "data": "{\"value\":20}",
        "dataType": "json",
        "mergecontext": "",
        "output_location": "payload.data",
        "output_location_type": "msg",
        "mustacheAltTags": false,
        "x": 730,
        "y": 180,
        "wires": [
            []
        ]
    },
    {
        "id": "a068603.44a51a",
        "type": "timeswitch",
        "z": "4aa87067.de46f",
        "name": "Daytime",
        "mytopic": "foo",
        "lat": "",
        "lon": "",
        "starttime": "45",
        "endtime": "1140",
        "duskoff": "0",
        "dawnoff": "0",
        "sun": true,
        "mon": true,
        "tue": true,
        "wed": true,
        "thu": true,
        "fri": true,
        "sat": true,
        "jan": true,
        "feb": true,
        "mar": true,
        "apr": true,
        "may": true,
        "jun": true,
        "jul": true,
        "aug": true,
        "sep": true,
        "oct": true,
        "nov": true,
        "dec": true,
        "x": 400,
        "y": 100,
        "wires": [
            [
                "b2a9c78b.f01028",
                "e43847cb.b91ae8"
            ]
        ]
    },
    {
        "id": "e43847cb.b91ae8",
        "type": "switch",
        "z": "4aa87067.de46f",
        "name": "Is true",
        "property": "payload",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "1",
                "vt": "str"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 1,
        "x": 550,
        "y": 100,
        "wires": [
            [
                "bc57180a.149778"
            ]
        ]
    }
]

Formatting:
Maybe I'm being dense here, but the How-To post you linked is the one I followed, and it looks right in my browser? I guess I'm not seeing the difference, sorry.

Steps to Reproduce:
From a blank Flow...

  • Drag a timeswitch node into the Flow.
  • Double click to edit.
  • Change "Time > On" dropdown to any specific time
  • Change "Time > Off" dropdown to any specific time
    Place > Lat/Lon fields disappear at this point
  • Click "Done" on editing dialogue
  • Click "Deploy" button to deploy
    A blocking warning dialogue appears with text "The workspace contains some nodes that are not properly configured: [Flow 1] timeswitch (timeswitch) Are you sure you want to deploy?"

About the formatting - the node in your original post wouldn't import, that's why I pointed you at that thread.

Good news - I can import this flow
Bad news - even following your directions I get no error.

What platform are you running NR on?

About the formatting - the node in your original post wouldn't import, that's why I pointed you at that thread.

Gotcha, cheers.

So, for posterity, it turns out I was not correctly updating the modules in my palette, so I was on v0.7.0 of the timeswitch module rather than the current v1.0. Seems this issue was resolved long ago, because updating correctly cleared the issue. /facepalm

Appreciate your help nonetheless!

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