GithubHelp home page GithubHelp logo

Comments (7)

tul avatar tul commented on May 29, 2024 1

For those finding this issue, the new pub call after the fix is now:

mosquitto_pub -t zwave/utility/heating/thermostat_mode/instance_2/mode/set -m '{"value_id":"3-64-2-0","node_id":3,"class_id":64,"type":"list","genre":"user","instance":2,"index":0,"label":"Mode","units":"","help":"","read_only":false,"write_only":false,"min":0,"max":0,"is_polled":false,"values":["Off","Heat"],"value":"Heat"}'

or, more minimally (given that the instance, index and value label are part of the topic):

mosquitto_pub -t zwave/utility/heating/thermostat_mode/instance_2/mode/set -m '{"value":"Heat"}'

from zwave2mqtt.

tul avatar tul commented on May 29, 2024

I've investigate a little, and the issue seems to be in Gateway.js here:

function onWriteRequest(parts, payload){
  var value = this.topicValues[parts.join('/')];

  if(value){
    payload = parsePayload(payload, value, value.conf, this.config)
    this.zwave.writeValue(value, payload);
  }
}

It seems that for the topic (utility/heating/thermostat_mode/mode in this case) only one value is stored in the this.topicValues which is the value for channel 1. So when setting channel 2, it is being routed to channel 1.

Could it be that the gateway only supports one value per topic currently?

from zwave2mqtt.

tul avatar tul commented on May 29, 2024

I am still quite new to ZWave, however I'm happy to look at creating a PR to resolve this issue if the maintainers could offer me a little guidance on their preferred approach.

from zwave2mqtt.

tul avatar tul commented on May 29, 2024

As a workaround, I have realised I can do

mosquitto_pub -t zwave/_CLIENTS/ZWAVE_GATEWAY-fluoron/api/setValue/set -m '{"args":[ { "node_id": 3, "class_id": 64, "instance": 1, "index": 0 }, "Heat" ] }'

and

mosquitto_pub -t zwave/_CLIENTS/ZWAVE_GATEWAY-fluoron/api/setValue/set -m '{"args":[ { "node_id": 3, "class_id": 64, "instance": 2, "index": 0 }, "Heat" ] }'

to control the two channels independently.

from zwave2mqtt.

robertsLando avatar robertsLando commented on May 29, 2024

Hi @tul, thanks for your issue!

It seems that for the topic (utility/heating/thermostat_mode/mode in this case) only one value is stored in the this.topicValues which is the value for channel 1. So when setting channel 2, it is being routed to channel 1.

This is correct and I will try to fix this. As workaround you can send a raw api request like you did or add two values on gateway values tables (Go to the web UI under Settings at the end and click on new value. Here you can select values from devices and choose a custom topic for them :)

from zwave2mqtt.

robertsLando avatar robertsLando commented on May 29, 2024

@tul Could you check if it works now? 😃 I have also updated Readme:

  1. Named Topics: Automatically configured. The topic where zwave values are published will be:

<mqtt_prefix>/<?node_location>/<node_name>/<class_name>/<?instance>/<value_label>

- `mqtt_prefix`: the prefix set in Mqtt Settings
- `node_location`: location of the Zwave Node (optional, if not present will not be added to the topic)
- `node_name`: name of the node, if not set will be `nodeID_<node_id>`
- `class_name`: the node class name corrisponding to given class id or `unknownClass_<class_id>` if the class name is not found
- `?instance`: Used just with multi-instance devices. The main instance (1) will not have this part in the topic but other instances will have: `instance_<instance_index>`
- `value_label`: the zwave value label (lower case and spaces are replaced with `_`)

from zwave2mqtt.

tul avatar tul commented on May 29, 2024

Hi @robertsLando - yes your fix has worked great, thanks very much for the quick response!

from zwave2mqtt.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.