Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when updating a Binary Sensor with the Node RED integration #219

Closed
carlos-sarmiento opened this issue Mar 11, 2020 · 1 comment
Closed

Comments

@carlos-sarmiento
Copy link

carlos-sarmiento commented Mar 11, 2020

Describe the bug

resubmitting because the other issue was auto closed due to formatting issues

I'm trying to create a Binary Sensor using the Sensor Node RED integration and I'm getting "Error handling message: expected bool for dictionary value @ data['state']. Got {'state': False, 'attributes': {'newest_version': '0.106.6', 'current_version': '0.106.6', 'newest_major_version': '0.106'}}".

To Reproduce

Steps to reproduce the behavior:

  1. Create a Sensor node in Node-RED,
  2. Configure as a Binary Sensor, add Name and set Input Override to Allow (also fails with Merge)
  3. Pass the following message (using inject):
{"payload":{"state":false,"attributes":{"newest_version":"0.106.6","current_version":"0.106.6","newest_major_version":"0.106"}},"_msgid":"ccf7399d.dd7dc8"}
  1. See error

Expected behavior

The sensor should be updated on HA, but it throws the error.

Screenshots

Example Flow

[
    {
        "id": "38aa5cad.9a4424",
        "type": "tab",
        "label": "Flow 1",
        "disabled": false,
        "info": ""
    },
    {
        "id": "e40fc3e3.8e2d7",
        "type": "inject",
        "z": "38aa5cad.9a4424",
        "name": "",
        "topic": "",
        "payload": "{\"payload\":{\"state\":false,\"attributes\":{\"newest_version\":\"0.106.6\",\"current_version\":\"0.106.6\",\"newest_major_version\":\"0.106\"}}}",
        "payloadType": "json",
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "x": 90,
        "y": 100,
        "wires": [
            [
                "231b3571.76ac1a"
            ]
        ]
    },
    {
        "id": "231b3571.76ac1a",
        "type": "ha-entity",
        "z": "38aa5cad.9a4424",
        "name": "",
        "server": "c3f734dc.de2678",
        "version": 1,
        "debugenabled": false,
        "outputs": 1,
        "entityType": "binary_sensor",
        "config": [
            {
                "property": "name",
                "value": "BinarySensor Test"
            },
            {
                "property": "device_class",
                "value": ""
            },
            {
                "property": "icon",
                "value": ""
            },
            {
                "property": "unit_of_measurement",
                "value": ""
            }
        ],
        "state": "payload",
        "stateType": "msg",
        "attributes": [],
        "resend": true,
        "outputLocation": "",
        "outputLocationType": "none",
        "inputOverride": "merge",
        "x": 270,
        "y": 100,
        "wires": [
            []
        ]
    },
    {
        "id": "c3f734dc.de2678",
        "type": "server",
        "z": "",
        "name": "Home Assistant",
        "legacy": false,
        "rejectUnauthorizedCerts": true,
        "ha_boolean": "y|yes|true|on|home|open",
        "connectionDelay": true,
        "cacheJson": true
    }
]

Environment (please complete the following information):

  • Node Red Version: 20.8
  • Node.js Version: Using Docker Image
  • NR Home Assistant Plugin Version: 0.21.5
  • NR Home assistant Integration: v0.4.1
  • Is Node Red running in Docker: yes (no Hassio)

Other (please complete the following information):

  • Have you searched previous issues for duplicates?: Yes

Additional context

@carlos-sarmiento
Copy link
Author

Thanks for the quick fix!

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

No branches or pull requests

1 participant