# Raspberry pi sense hat - No topic dialog

**URL:** <https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524>\
**Category:** General\
**Created:** [22 July 2020 04:30 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524 "2020-07-22T04:30:55Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![jfk](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jfk](https://discourse.nodered.org/u/jfk)\
**Post date:** [22 July 2020 04:30 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/1 "2020-07-22T04:30:55Z")

</div>

Hi,

The sense hat appeared to install ok, however in the property sheets there is no opportunity to edit the topic or the payload. Is this a common config issue or not? please

pi@raspberrypi:~/.node-red/node\_modules pi@raspberrypi:~/.node-red/node\_modules   
pi@raspberrypi:~/.node-red/node\_modules $ npm install node-red-node-pi-sense-hat  
npm WARN node-red-project@0.0.1 No repository field.  
npm WARN node-red-project@0.0.1 No license field.

- node-red-node-pi-sense-hat@0.0.18  
updated 1 package and audited 242 packages in 5.062s

3 packages are looking for funding  
run `npm fund` for details

found 0 vulnerabilities

pi@raspberrypi:~/.node-red/node\_modules $

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [22 July 2020 07:07 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/2 "2020-07-22T07:07:25Z")

</div>

Does the info or readme not tell you what it uses ?

---

<div class="post-metadata">

**Author:** ![jfk](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jfk](https://discourse.nodered.org/u/jfk)\
**Post date:** [22 July 2020 07:23 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/3 "2020-07-22T07:23:16Z")

</div>

I does as per the enclosed, however as I say there is no ability to set the topic or payload to direct the ouptut

 ![2020-07-22-142127_1920x1080_scrot](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/8/1/81134115e84207acbf855a644e667c98c6ba1229.png)

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [22 July 2020 07:45 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/4 "2020-07-22T07:45:41Z")

</div>

The node sets `msg.topic` to identify the type of event it's sending a message for.

The payload is the value of the event. It wouldn't make sense for you to set a hardcoded payload as you'd lose the sensor data.

---

<div class="post-metadata">

**Author:** ![jfk](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jfk](https://discourse.nodered.org/u/jfk)\
**Post date:** [22 July 2020 08:13 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/5 "2020-07-22T08:13:06Z")

</div>

Thanks for the response, I understand what your saying. Clearly I am not understanding how this node works. I want to take the outputs and send them out via an MQTT message.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [22 July 2020 08:26 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/6 "2020-07-22T08:26:56Z")

</div>

> [@jfk](#):
>
> I want to take the outputs and send them out via an MQTT message.

You can connect the SenseHat node straight to an MQTT node and it will publish the messages using the topic set by the SenseHat node, unless you hardcode a topic in the MQTT node.

Or you can add a Change node to customise the topic before passing it to the MQTT node.

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [22 July 2020 09:20 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/8 "2020-07-22T09:20:50Z")

</div>

> [@cymplecy](#):
>
> The messages don't have any topics assigned to them

Yes they do:

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/2/7/270d89786eb8e0817508760200faf08c6722a111.jpeg)

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [22 July 2020 09:22 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/9 "2020-07-22T09:22:12Z")

</div>

ooops - replaces glasses  
I'll amend my code 🙂

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [22 July 2020 09:39 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/10 "2020-07-22T09:39:26Z")

</div>

2nd attempt now I've found my glasses 🙂  
If you connect a debug node - you can see that its sending the motion and the environment info out as two separate messages (with a joystick message when you do something with it)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/6/3/63f04abcd248371d694c574f11cc94832a936cc8.png)

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/0/10f98b574d2ffbe34b234b79ad55818870bcc982.png)

Each of the messages has a different topic assigned to them.

So if you leave the topic empty on your MQTT out node, they'll all get sent to 3 different topics.

But if you'd like to group them under a specified topic, you can just add a change node to help do this

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/d/c/dc86954c6150d207fe32102c4f9d03d89e2e0b76.jpeg)

and they'll end up on your broker like this

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/c/bce57f41e68d688202257259fa9919ab210085e6.png)

[edit] - slightly less typing if you don't mind using some JSONata to just prefix on all topics

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/a/8/a868fd274d5498a297683a2a6717b893ae6f1d8a.png)  
[/edit]

---

<div class="post-metadata">

**Author:** ![jfk](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jfk](https://discourse.nodered.org/u/jfk)\
**Post date:** [22 July 2020 22:56 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/11 "2020-07-22T22:56:21Z")

</div>

Thanks for all the responses, I have connected it to debug and MQTT nodes etc, however I am going to rebuild the machine I have NR running on as it has been bashed around a good deal and I would not be surprised if there a few issues. This morning the palette no longer recognises the hat nodes at all. time for a lobotomy and restart....

 ![2020-07-23-084441_1920x1080_scrot](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/8/0897144296b05c868cf0e9d49c8eaf2205c5f7a0.png)

---

<div class="post-metadata">

**Author:** ![jfk](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jfk](https://discourse.nodered.org/u/jfk)\
**Post date:** [23 July 2020 12:30 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/12 "2020-07-23T12:30:53Z")

</div>

Rebuilt the PI4 sticking to the instructions on the Running on RPi page, all working.. thanks for the responses

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [24 July 2020 13:52 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/13 "2020-07-24T13:52:08Z")

</div>

Not suggesting this needs doing quickly but would making the topic names explicit and editable be a good idea?

Also, what about the concept of having a editable prefix as well?

I played with a copy of the node to produce a POC

 ![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/0/e/0e2adb9012c225366fd513693dfca8442ffe273b.png)

Is it worth me carrying on to produce a full PR?

---

<div class="post-metadata">

**Author:** ![knolleary](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/knolleary/32/3_2.png) [@knolleary](https://discourse.nodered.org/u/knolleary)\
**Post date:** [24 July 2020 14:21 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/14 "2020-07-24T14:21:02Z")

</div>

From a UI design point of view, I'd suggest putting each topic input below the corresponding checkbox and enable/disable the input according to the selection.

And I wouldn't separate out the prefix as its just another thing a user has to then mentally parse and understand, rather than just seeing the explicit topics being used.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [24 July 2020 16:23 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/15 "2020-07-24T16:23:04Z")

</div>

> [@knolleary](#):
>
> And I wouldn't separate out the prefix...

Yes - and it only makes sense if sending onto a MQTT node anyway

Did a few modified drafts - not sure about using plain Topic or msg.topic

 ![1](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/e/e/ee47b0e9b6c8cdb1a0dde3b298739cdc2abf1102.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/b/3/b36354d849fe28ce578efa9e49ee325e62cddb2f.png)

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/f/0/f018f809766846ca729ae49ecb1781f168e62afd.png)

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [24 July 2020 18:23 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/16 "2020-07-24T18:23:54Z")

</div>

What is the problem with letting a change node do what it is good at ?

---

<div class="post-metadata">

**Author:** ![jfk](https://avatars.discourse-cdn.com/v4/letter/j/ed8c4c/32.png) [@jfk](https://discourse.nodered.org/u/jfk)\
**Post date:** [25 July 2020 02:53 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/17 "2020-07-25T02:53:42Z")

</div>

Just my 2c worth but reading the trail, I was thinking I would most likely use a change node more often than not

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [23 September 2020 02:54 UTC](https://discourse.nodered.org/t/raspberry-pi-sense-hat-no-topic-dialog/30524/18 "2020-09-23T02:54:05Z")

</div>

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