SergiuToporjinschi / node-red-contrib-heater-controller

Heater controller for node-red dashboard
GNU General Public License v3.0
18 stars 17 forks source link

No value on deashboard #80

Open Cricri54 opened 2 years ago

Cricri54 commented 2 years ago

Hi Sergiu I installed the new version of node-red-contrib-heater-controller but the display is not working. I have no value on the dashboard just "calendar is missing". The heater-controller work but not the frontend. My config :

Can you help me.

Thanks

SergiuToporjinschi commented 2 years ago

Hi, Like this? image If is so, it means you did not sent the first current temperature message. Please read the read.me file of this project.

Cricri54 commented 2 years ago

Hi, Yes like this. But i sent the first currentTemp. I have a temperature probe which periodically sends the value of the current temperature. The out is OK, but the display don't work.

Example of out : {"currentTemp":20.1,"targetValue":22,"isUserCustom":false,"currentSchedule":{"time":"16:40","day":"Wednesday","temp":22},"nextSchedule":{"time":"23:59","day":"Wednesday","temp":19},"currentHeaterStatus":"on","time":"08/12/2021, 21:45:16"}

Thanks

SergiuToporjinschi commented 2 years ago

Can you put here an input example?

SergiuToporjinschi commented 2 years ago

and keep in mind, each time when the schema is deploy all retained information in the node are gone. So if you are looking immediately after deploy the last current temp has been lost, you have to wait for the next one. You can create your own logic to keep the last value stored and trigger an inject with that immediately after deploy/restart

Cricri54 commented 2 years ago

My probe sends its value every minute but after a day still no display.

SergiuToporjinschi commented 2 years ago

{ "topic" : "currentTemp", "payload" : 22.5 } are you sure that the entire message looks like this? this should not be the payload should be the body of the message you can disconnect all entries and try to add a insert node connected to the heater input. Deploy it and then push the button of the insert node

image

Cricri54 commented 2 years ago

I did the test but it still doesn't work.in output I have the values ​​but not on the display.

SergiuToporjinschi commented 2 years ago

hmmm something is wrong, I would say on your side, but I'm not sure. Can you create a new flow with the heater and the insert node bind to the heater and then export the flow and attach it here? this way I think I can debug it

Cricri54 commented 2 years ago

A test's flow : [ { "id": "c415f0a0e0873ef5", "type": "tab", "label": "Flow 1", "disabled": false, "info": "", "env": [] }, { "id": "39f02d0253e80d48", "type": "inject", "z": "c415f0a0e0873ef5", "name": "currentTemp", "props": [ { "p": "topic", "vt": "str" }, { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "currentTemp", "payload": "22.5", "payloadType": "num", "x": 210, "y": 240, "wires": [ [ "3761a0c97279ed4e" ] ] }, { "id": "3761a0c97279ed4e", "type": "ui_heater_controller", "z": "c415f0a0e0873ef5", "name": "heater", "group": "85726d886808ce52", "unit": "C", "displayMode": "buttons", "order": 0, "width": 6, "height": 4, "topic": "", "title": "Heater", "logLength": 0, "sliderMinValue": 10, "sliderMaxValue": 35, "sliderStep": 0.5, "threshold": 0.5, "calendar": "{\n \"Monday\": {\n \"00:00\": 19,\n \"06:20\": 22,\n \"08:00\": 19,\n \"16:40\": 22,\n \"23:59\": 19\n },\n \"Tuesday\": {\n \"00:00\": 19,\n \"06:20\": 22,\n \"08:00\": 19,\n \"16:40\": 22,\n \"23:59\": 19\n },\n \"Wednesday\": {\n \"00:00\": 19,\n \"06:20\": 22,\n \"08:00\": 19,\n \"16:40\": 22,\n \"23:59\": 19\n },\n \"Thursday\": {\n \"00:00\": 19,\n \"06:20\": 22,\n \"08:00\": 19,\n \"16:40\": 22,\n \"23:59\": 19\n },\n \"Friday\": {\n \"00:00\": 19,\n \"06:20\": 23,\n \"08:00\": 19,\n \"16:40\": 22,\n \"23:59\": 19\n },\n \"Saturday\": {\n \"00:00\": 19,\n \"08:00\": 20,\n \"20:00\": 22,\n \"23:59\": 19\n },\n \"Sunday\": {\n \"00:00\": 19,\n \"08:00\": 20,\n \"20:00\": 22,\n \"23:59\": 19\n }\n}", "x": 450, "y": 240, "wires": [ [ "8ee66715e44d1a34" ], [ "413fa0dacc6f2d48" ] ], "inputLabels": [ "currentTemp | userConfig | setCalendar | config | status" ], "outputLabels": [ "Heater status", "Info" ] }, { "id": "413fa0dacc6f2d48", "type": "debug", "z": "c415f0a0e0873ef5", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 680, "y": 320, "wires": [] }, { "id": "8ee66715e44d1a34", "type": "debug", "z": "c415f0a0e0873ef5", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 760, "y": 160, "wires": [] }, { "id": "85726d886808ce52", "type": "ui_group", "name": "chauffage", "tab": "65eccc9653e3fa6e", "order": 2, "disp": true, "width": "8", "collapse": false, "className": "" }, { "id": "65eccc9653e3fa6e", "type": "ui_tab", "name": "Maison", "icon": "dashboard", "order": 2, "disabled": false, "hidden": false } ]

SergiuToporjinschi commented 2 years ago

image is working for me I'm using node-red 2.0.6 what version do you have? did you tried on different browser? how is installed? I don't know, you have to find some more info because is the first time that I get this issue nobody complained about this and I'm afraid I cannot help if I cannot reproduce it ... :( try to find some logs or so maybe an error message even you can open dev tools maybe is something there ...

Cricri54 commented 2 years ago

My version of node-red is 2.1.4

Cricri54 commented 2 years ago

I tried on another browser but still the same. i can't find some logs or error message. Too bad, I would have liked to use this node.

exlicite commented 2 years ago

I have same issue with node-red v2.1.4 previous node-red version 2.0.4 have also same issue. Node version is v14.17.3.

I not found log in node-red log.

It's same on Chrome and Safari browser.

MartinGris commented 2 years ago

Same issue here. It occurs when using node red with https. See the browser console for detailed errors. It's a problem with the unsecure websocket endpoint.

exlicite commented 2 years ago

After chrome debug, i found the mistake in my case. Nodered with heater controller is behind reverse-proxy. The websocket should have an explicite rule to proxy it.

I had this entry in my apache conf. ProxyPass /heaterController ws://a.b.c.d:1880/heaterController ProxyPassReverse /heaterController ws://a.b.c.d:1880/heaterController

MartinGris commented 2 years ago

My solution was to change the protocol to 'wss' in nodes/heater/frontEnd.js line 42. I'm using https directly in node js and not via a reverse proxy

dreamsinbits commented 1 year ago

I had the same problem, thanks to @MartinGris I solved it. I also changed the protocol to wss. Because I have a setup with a reverse proxy (nginx) I had to add this to my nginx configuration file:

# heater controller websocket
 location /heaterController/io/ {
       proxy_pass http://node-red_app:1880/heaterController/io/; # change to whatever host/port the docker container is listening on.
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header Host $host;
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
}