Questions on implementing in the real world



  • Hi,

    I like your work it has a lot of potential, being a .NET programmer i find this controller the most easy (for me) to understand and perhaps enhance in the future.
    Having said that, i find that it misses some functionality and examples (or i missed something).

    Couple of questions:

    1. i can see that you have a switch UI node and i can understand that i need to connect its out to the in of lets say some actuator node like a relay node. The question is how do i get the hardware node, in this case the relay, to switch the switch node according to its state? i dont see an input for any of these buttons/switches. perhaps its done automatically and i just missed it?
    2. I wanted to use a roller shutter node, and as you probably know this node has 4 different datatypes (or what ever they are called), V_UP, V_DOWN, V_STOP etc. i noticed that when i connected the shutter node the hardware node that i get has only one input and output, is this even supported? How can i get this done?

    I appreciate your help on this, as i already said it looks like a great controller platform with a lot of potential.

    Thanks.


  • Contest Winner

    @dpressle Hi. Yeah, I haven't made inputs in the buttons/switches yet. For now, you can use a UI State node as a workaround. If you want to experiment with coding, you can try to do it. Just look at the source code of the UI State and UI Switch, and put them together. It is not difficult in principle.

    At the moment I have not solved the problem of implementing multiple data types in one sensor. The difficulty caused by the fact that I can't find out what type of data the sensor supports. This is not possible in the mysnsors protocol. I would have to draw lots of inputs/outputs at each node to support all types that are possible. It wouldn't be right. It would be possible to make a manual adjustment of data types, but it is not very convenient. So I did limitation: one sensor - one data type. If anybody tell me the solution how it can be implemented, I'll do it.


  • Contest Winner

    So, to make the node which supports 4 different datatypes, just write in the firmware that you have 4 sensors.



  • @derwish Thanks for the answer, i will try what you suggested regarding the switch input and the multi sensor solution.

    Regarding the multi type issue why cant you hard coded the inputs/output of a node by its type so for example if you have a S_COVER node just create 3 in/out V_UP, V_DOWN, V_STOP etc


  • Contest Winner

    @dpressle Because I don't want to see V_TRIPPED and V_ARMED on each button/relay, etc. 99% that the second pin will not be used.

    For Dimmer it will be V_STATUS, V_DIMMER, V_WATT.
    For Temp - V_TEMP, V_ID.
    For Baro - V_PRESSURE, V_FORECAST.
    For Rgb light - V_RGB, V_WATT
    Such a huge number of pins will be very confused. Even more confusing is the fact that it is not clear - this data type should be sent to the device or receive from it (V_STATUS, V_DIMMER, V_WATT - ? ? ?).



  • @derwish, i can see your point how ever for me its not that bad, i have no problem to see all my options even if i dont use them.
    Maybe ill just do it myself...

    BTW, the status switch worked grate i will now add shutter UI node as well...

    I also would like to write a MQTT node how would you suggest me to do it? i thought of writing a custom UI node would that work?


  • Hero Member

    @derwish I also support the idea of having more "pins"/types on each sensor rather than having to rework all my nodes.
    That would be like having different doors to my restroom 😏


  • Contest Winner

    @dpressle Send me a pull-request with a modified switch, please.
    I'm not experienced with MQTT, so I can not tell on its implementation, but if there are any questions on the code, contact me on skype/telegram/email.

    I also recommend this cpu usage hotfix:
    In nodesEngine.cs:
    private void UpdateNodesLoop()
    {
    Task.Run(() =>
    {
    while (true)
    {
    Thread.Sleep(10);
    if ((DateTime.Now - lastUpdateTime).TotalMilliseconds < updateInterval)
    continue;


  • Contest Winner

    @AWI It would probably be wise to make it optional.


Log in to reply
 

Suggested Topics

73
Online

11.4k
Users

11.1k
Topics

112.7k
Posts