Node-RED nodes for hubitat

Oh, I have it in a function node because I have to switch the color based on the mode

Then JSON.stringify() that puppy right? Note: I have not done the multi-argument thing in a while so apologies if this is leading you astray.

2 Likes

Yep, that did it! Thanks!

2 Likes

Looking for some advice from the Node Red gang please.

As part of my process of trying to get rid of anything where I end up being dependant on Google/Amazon/Sonos software and firmware, I've been experimenting with using the Raspi/Node Red combination to run my TTS directly. I have a USB sound card setup feeding into a a small 12V Amp which in turn runs a couple of hard wired speakers. Even with cheap, small speakers as a testbed the sound quality is not too bad at all.

I have a rudimentary system running which uses downloaded MP3 files created using https://ttsmp3.com/ for all of my TTS warnings. I don't have a huge range of messages and none have to have variables in them so I just spent some time on that site creating any message I was likely to need. They are now stored on the Pi.

Using an Exec Node to run mplayer it is working well with no annoying Google Mini pre message "bong" sound either.

For the next stage I was wondering about using some decent quality speakers and actually using the system for Music as well. That is where I have run into some issues. The command line interface for mplayer is not well documented and I couldn't even find a command line to stop or pause a track. I ended up havng to kill the process to stop it. I have looked at other players like mpg321 but nothing seems to do all that I would want which is why I was hoping someone here would have some experience and could point me to a player that:

  1. Can easily be controlled from Node Red either from an Exec Node or via a specialist Node
  2. Can play a directory of MP3 files (ideally with random option) as well as a single file
  3. Can by paused/resumed/stopped/skipped to next track etc
  4. Ideally Play an Internet Radio stream as well as MP3s

As a further bonus if there is a way to pause whatever is playing when I want to play a TTS file and then resume where it was after it has played that would be perfect.

Thanks in advance!

I have a Synology and uses its music API to push music onto upnp order dlnA players. Do you have a NAS or other to play music from or are you playing from a local hdd?

I'm planning to put all my MP3s directly on the Pi.

I have never done that, but there are node red nose for playing local files.

1 Like

Yes there are and I've got a basic system working to play the TTS files, it was when it came to a full on music player that I was struggling.

But I've just started testing xmms2 which looks pretty hopeful so far.

1 Like

How would I make the word Move bold in the change node below, with Jsonata expression?

image

I'm sending it to a dashboard, and I've just added in the battery percentage, but the non-bold is affecting my OCD. This is part of a flow that auto joins my Sonos speakers to be based on motion sensor movements in their respective rooms.

image

Hey guys, I've been playing around with this palette in node-red and it's really great. I'm converting some of my rule machine rules and came across one issue that hopefully someone can help me with:

I'm trying to send a notification to the hubitat app on my phone when my doors are unlocked (with the lock name and the name of the person who unlocked it), but the "Arguments" field in the command node for deviceNotification doesn't seem to parse variables. I tried using msg.payload.descriptionText, msg.payload and a global variable. What am I doing wrong?

I am not 100% sure I understand what you're trying to do but have you looked at the Template Node? It allows you to take a bunch of different payload items and combine them into one and then output as msg.arguments for example.

2 Likes

Correct, it does not (at least not as far as I remember, I would never do it that way so haven't ever tried). Expand the variables to strings in a change node before the command node. Stick them in msg.arguments.

2 Likes

Thanks @stephen_nutt and @JasonJoel - setting msg.arguments in a change node right before the command node worked!

1 Like

Welcome to the HE NR rabbit hole! :rabbit: :hole:

Also check out this thread for ideas... lots of cool stuff.

and this too...

3 Likes

@erktrek Thanks for those links. I had spent some time searching for a passthrough type of node to reduce the number of connecting lines...couldn't find one and wound up using a switch node with a single 'otherwise' case. On that second link you sent there's a node listed under must haves that does exactly what I was looking for :smiley:

3 Likes

Yeah, no-op is handy - especially when I'm spit-balling something and making a lot of changes adding/deleting nodes.

Sometimes I also use a lot of link-in/out to "pretty up" a flow if there are a ton of connections.

5 Likes

Anyone updated to Node Red 2.0.1 yet ?

I've been running node-red 2.0 since beta 1 on my dev .instance. will probably wait a few weeks to upgrade my production one.

3 Likes

rain is expected in the next week and it's on my todo list to test all the functionality of the hubitat nodes on the new version :crossed_fingers:

4 Likes

I only recently found out that I could get the labels to show for the link nodes! Makes it easier to follow the links now.

5 Likes