Code Monkey home page Code Monkey logo

Comments (8)

andrei-tatar avatar andrei-tatar commented on May 30, 2024

I think it's fine... Here is how I have it setup:
image
The red node is the actual hardware switch. So each change (from switch/google/dashboard) is reported back to the others and vice versa.

from node-red-contrib-nora.

nosaj66au avatar nosaj66au commented on May 30, 2024

from node-red-contrib-nora.

andrei-tatar avatar andrei-tatar commented on May 30, 2024

@nosaj66au Maybe you need to connect the Physical Switch output to the inputs of the dashboard and google home nodes.

from node-red-contrib-nora.

impala454 avatar impala454 commented on May 30, 2024

I realize this is closed but I am noticing a similar issue. I'm using an MQTT topic as a secondary "switch" to the nora light node. I can't really tie the two together the way @andrei-tatar did above as the MQTT output payload is different than the nora input payload. Thumbing through the code, it appears I simply need to send a JSON object to the nora node like this (this is actual output from my flow's debug):

{"payload":{"on":true}}

This gets sent to the input of the nora light node but my device in google home never updates. It does update when I toggle the light using the google home app though. Here is my flow:
nora_flow
The GetNoraPayload function node is just changing the message to match what the nora node is looking for. Code here:

on_off = msg.payload.value;

msg = {};
msg['payload'] = {};
msg.payload['on'] = on_off;

return msg;

Any help or thoughts appreciated. If this works out I'll definitely donate something to the cause!

from node-red-contrib-nora.

sarreck avatar sarreck commented on May 30, 2024

I have successfully deployed a working version of this.

The trick was converting the STRING from MQTT to a BOOLEAN state

image

There is a switch to output true/false then they are converted to the Boolean state. Same on the other end.

I am sure there is a more efficient way to do this, but it works.

from node-red-contrib-nora.

impala454 avatar impala454 commented on May 30, 2024

@sarreck can you show what you're doing in your switch and change nodes?

I have my MQTT topic input set to output a parsed JSON object, so it's definitely not outputting as a string. I verfied by debug the contents are::

{"time":1582090043840,"value":false}

I modified the GetNoraPayload function to make sure it's outputting what the nora light node needs and here's where it ended up:

on = false;

if (msg.payload.value === true) {
    on = true;
}

msg = {};
msg["payload"] = {};
msg.payload.on = on;

return msg;

I verified that output with debug here:

{"on":false}

Which is what the nora light node says it needs to update state.

from node-red-contrib-nora.

sarreck avatar sarreck commented on May 30, 2024

Switch
image

Change
image

from node-red-contrib-nora.

impala454 avatar impala454 commented on May 30, 2024

Thanks for this, it made me realize since it's a simple switch (not dimmable or colored) that I just needed to send the raw bool and not the full JSON string. I also noticed with the switch on the screen under google home it wasn't immediately updating, I just had to refresh it or back out to the previous screen, which is no big deal. Thanks!

from node-red-contrib-nora.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.