Comments (7)
Hi, i'm taking a look at the user manual...
from node-red-contrib-knx-ultimate.
Excellent. If I can support you, let me know!
from node-red-contrib-knx-ultimate.
Hi Cold, what's your name? I'm Max.
Basically, it works like the "tunable white" controls, but with HUE, Saturation and brightness and with slight changes to the statuses GA.
I'll work on that.
The main issue is to retrieve and read the HUE color wheel.
Can you share here some code you used, to let me save some time?
from node-red-contrib-knx-ultimate.
Hi Max,
yes I think this is basically the case for saturation and brightness.
For Hue its the degree on an color wheel.
My current implementation is far from perfect, but basically it works like this:
- Use hue lamp current color (in my case, saved in an subflow)
- Change the values
- Convert HSV -> RGB
- Set RGB to hue lamp
My code looks like this:
- I only change hue, as i don't need saturation and brightness (both at 100%).
- I use node-red-contrib-looptimer2 to repeat the command until the stop command is received.
- I use node-red-contrib-color-convert to convert from HSV to RGB.
[{"id":"0f254daf2271a72b","type":"looptimer2","z":"cc2d22b7145c4de5","duration":"0.5","units":"Second","maxloops":"100","maxtimeout":"1","maxtimeoutunits":"Minute","name":"","x":370,"y":220,"wires":[["3957120ceaf4e1e7","c647e9e28f005820"],["be82a6b2865fca59"]]},{"id":"939b714536929f5d","type":"function","z":"cc2d22b7145c4de5","name":"","func":"if (msg.payload.data === 0) {\n return {payload:\"STOP\"}\n} else {\n let sign = (msg.payload.decr_incr === 0) ? -1 : 1;\n return {payload: sign * msg.payload.data * 10}\n}\n","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":180,"y":220,"wires":[["0f254daf2271a72b"]]},{"id":"3957120ceaf4e1e7","type":"function","z":"cc2d22b7145c4de5","name":"hue -> HSV","func":"let flowHue = flow.get(\"colorHue\")\n\nlet hue = flowHue ? ((flow.get(\"colorHue\") + msg.payload) % 360) : 0\nhue = (hue < 0) ? hue +360 : hue; \nflow.set(\"colorHue\", hue)\n\nreturn {payload: [hue, 100, 100]};","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":830,"y":220,"wires":[["bf38073094f528a7"]]},{"id":"bf38073094f528a7","type":"color-convert","z":"cc2d22b7145c4de5","input":"hsv","output":"rgb","outputType":"array","scaleInput":true,"x":1010,"y":220,"wires":[["cd866f929ab6820b"]]},{"id":"cd866f929ab6820b","type":"function","z":"cc2d22b7145c4de5","name":"-> payload.rgb","func":"\nreturn {payload: {rgb: msg.payload}};","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":1200,"y":220,"wires":[[]]},{"id":"c647e9e28f005820","type":"change","z":"cc2d22b7145c4de5","name":"","rules":[{"t":"set","p":"running","pt":"flow","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":200,"wires":[[]]},{"id":"be82a6b2865fca59","type":"change","z":"cc2d22b7145c4de5","name":"","rules":[{"t":"set","p":"running","pt":"flow","to":"false","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":590,"y":260,"wires":[[]]}]
For saving the hue value I just convert the hue lamps RGB to HSV and save the H part:
[{"id":"52cfe893.a0bdc8","type":"change","z":"c73b7b76.eb5d18","name":"","rules":[{"t":"set","p":"colorHue","pt":"flow","to":"payload","tot":"msg"}],"action":"","property":"","from":"","to":"","reg":false,"x":1130,"y":180,"wires":[[]]},{"id":"7f8a301e.f01a9","type":"color-convert","z":"c73b7b76.eb5d18","input":"rgb","output":"hsv","outputType":"array","scaleInput":false,"x":570,"y":180,"wires":[["419aeeac.de433"]]},{"id":"681f3a71.db4c64","type":"function","z":"c73b7b76.eb5d18","name":"payload.rgb ->","func":"return {payload: msg.payload.rgb};","outputs":1,"timeout":"","noerr":0,"initialize":"","finalize":"","libs":[],"x":380,"y":180,"wires":[["7f8a301e.f01a9"]]},{"id":"419aeeac.de433","type":"function","z":"c73b7b76.eb5d18","name":"payload[0]","func":"\nreturn {payload: msg.payload[0]};","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":750,"y":180,"wires":[["fc1d950e.aaefb8"]]},{"id":"fc1d950e.aaefb8","type":"switch","z":"c73b7b76.eb5d18","name":"","property":"running","propertyType":"flow","rules":[{"t":"true"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":910,"y":180,"wires":[[],["52cfe893.a0bdc8"]]}]
I hope this helps a little bit.
Best regards
Daniel
from node-red-contrib-knx-ultimate.
A thing on the side:
I played around with the HA template and noticed, that it is currently not possible to have color and tuneable white:
https://community.home-assistant.io/t/solved-flapping-states-knx-light-card/667139/12
There are versions for https://www.home-assistant.io/integrations/knx/#rgbw_address
but I don't have any KNX lights that support that.
I thought I share my findings as soon as possible for you.
from node-red-contrib-knx-ultimate.
Hi
Do you have your MDT set like this?
https://youtu.be/cx85Y5eTSHQ?t=528
from node-red-contrib-knx-ultimate.
Out in 2.4.5-beta.1 https://github.com/Supergiovane/node-red-contrib-knx-ultimate/milestone/24
from node-red-contrib-knx-ultimate.
Related Issues (20)
- 我想读取组地址状态
- About Havc Modes HOT 2
- KNX TS support HOT 2
- Send write TypeError: value.toFixed is not a function HOT 4
- 4-Byte Values from KNX are sent as 0 HOT 8
- Hue Button/Dimmer-Switch with integrated "inverter" option HOT 12
- Cannot install node red palette knx ultimate HOT 2
- KNX Device node TimeofDay datatype HOT 5
- Application Log shows received data but KNX Device does nothing HOT 2
- Problem after Node-Red restart or deploy HOT 2
- KNX Scene n. 64 is missing in Hue Scene Node HOT 2
- KNX Gateway connection issue HOT 1
- HUE Tunable White Status is not working HOT 20
- Listening to the KNX bus? HOT 7
- Auto reconnect every seconds HOT 5
- Custom DPT support HOT 2
- Add docs HOT 1
- setConfig issues HOT 6
- More info on NR messages output by device nodes HOT 5
- Support parameters from env variables HOT 17
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node-red-contrib-knx-ultimate.