• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

Home automation course problem

Q&A Forum › Category: Home Automation › Home automation course problem
0 Vote Up Vote Down
merkelck asked 6 years ago

https://pastebin.com/2VPbL6NV
Let me know if this works. I am new at paste.bin.
This is the sketch of my course and I have managed to work through it and have one problem that I can’t seem to find. The Temperature feature will not show a value in the dashboard. The gauge is there but now value will be presented. The serial monitor shows the humidity, both C and F temps as well as the heat index value. It produces values every two minute as expected. I have removed the temp and replaced the temp section from the flow, The blank gauge is displayed with the correct values as selected, the needle is on the lower left side but it never shows any value. The same thing happens on my phone as well. There just seems to be some disconnect between the ESP8266 and the MQTT. I tried a different ESP8266 but with the same results . I was certain that I had misspelled something somewhere and maybe I have but I have looked it for long that I just don’t see it. Almost every error I have had has been some typing error and after awhile they get hard to see.
Please let me know if the text file with the flow worked. As I mentioned, I have never used the “Paste.bin” before .
Thank you

7 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

Yes, that Pastebin is perfect and I can load your flow in my Node-RED. 
(Note: you should always delete any credentials username/password when you post on Pastebin or GitHub).
Ok, let’s see what it can be:

  • Your Node-RED flow looks correct and the MQTT topics too
  • If the ESP is printing the DHT readings in the Serial Monitor it’s a great step
  • Double-check that you’ve entered the right MQTT broker in the Arduino code
  • Can you add the following debug nodes to the MQTT node? Does it print any messages in the debug window every 2 seconds? (After deploying your flow)


Thanks for posting your detailed problem. Regards,
Rui

0 Vote Up Vote Down
merkelck answered 6 years ago

https://imgur.com/AbLjlpS
https://imgur.com/hM7z9dj
 
Rui, thanks for the tips. But I have not found anything wrong yet. One photo shows the serial monitor and the other shows the nodered flow/debug outputs. The SM clearly shows that data is being produced but for some reason the debug window shows that the temperature string value is “0”. If I had made an error in the broker designation, would the humidity work?
Regarding the debug messages, they occur every thirty seconds just like the SM entries. I am not sure what you are referring to regarding “2secs”. 
In addition to other things, I tried a different NodeMCU device and the results were the same.
Regards
 

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

Can you post the section of your Arduino code that is publishing the temperature via MQTT to Node-RED? Please post that full section, because it looks like it’s a problem with the variable type. Thanks!

0 Vote Up Vote Down
merkelck answered 6 years ago

I found the problem with the temp readings. The problem was an error in the code. The two versions of the code came from different sources. The correct version was copied from the pdf file included with the course. The incorrect code came from the downloaded code in the code folder called “mqtt-esp8266-final” . The two versions are included in two images attached. I am not sure what the two numbers represent unless they are actually the number of digits in the string. One version says [6] and the correct one says [7]…
https://imgur.com/tzcvzkq
https://imgur.com/veMFbXa
They deal with the temp and humidity. But I did find out that they both have to be correct. They actually occur in three places but one area is commented out depending on your choice of  C or F display.
I am moving on to my next issues with “smoke” and “motion”.  I am trying to decide if these two displays are supposed to reset or if once triggered, do they have to be manually reset.
Maybe you can provide with an explanation of these two sensors.
Thanks for your help

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

Thanks for letting me know! I’ve updated the code on GitHub with the correct size [7] in those three variables: https://github.com/RuiSantosdotme/Home-Automation-Course/blob/master/code/v2/mqtt_esp8266_final.ino
Those two sensors are reseted manually through the Node-RED dashboard (you’ll need to disarm and arm again, after they are triggered).
Thanks again!

0 Vote Up Vote Down
Greattechy answered 6 years ago

Can i connect upto 8 sonoffs to the raspberry pi

0 Vote Up Vote Down
Rui Santos Staff answered 6 years ago

Yes, you can connect as many SONOFFs as you need via MQTT to a Raspberry Pi. You just need to assign different MQTT topics, so they don’t interfere with each other.

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025
  • [eBook Updated] Learn ESP32 with Arduino IDE eBook – Version 3.2 April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.