Is ELV Max! a reliable system compared to FHT80b (or ZWAVE)

Forum about MQTT, machine-to-machine (M2M), "Internet of Things" and Node.js

Moderators: Digit, Rene, Willem4ever, Bwired

Is ELV Max! a reliable system compared to FHT80b (or ZWAVE)

Postby pbrand » Wed Dec 18, 2013 9:25 am

Rene wrote:I have in 6 rooms a Max room thermostat which control each one or more radiator thermostats. A node.js application communicates with the Max cube and publishes each event, a change in temp, setpoint or valve opening, via Mqtt. A rules engine based on nools.js listens to all events and as soon as one room thermostat reports a setpoint which is higher than the current temp it issues a command via mqtt to start heating. Again a node.js application, connected to the otgw, picks up this command and raises the setpoint of an iSense room thermostat connected to a Remeha Calenta boiler. As soon as all setpoints are reached the rules engine orders the otgw ro lower the setpoint. I have this solution working for a few weeks now and it is working allright. Previously rooms were not heated becuase the temp in the living room matched the setpoint. Now I can control the temp in each room individually.


Hi Rene,

Can you perhaps share the structure of your MQTT events? Curious on what your solution is.

Because I don't have a physical boiler but just a valve in the city heating pipes which I can control, I think I will use a ZWAVE relais to open the valve when heat is needed (and the algorithm for heat needed will be something like when one of the max! valves reports an opening of say more than 25% percent).

Your solution looks very nice too!
pbrand
Member
Member
 
Posts: 100
Joined: October 2008
Location: Netherlands

Is ELV Max! a reliable system compared to FHT80b (or ZWAVE)

Postby Rene » Wed Dec 18, 2013 6:10 pm

FoRMaTC wrote:Maybe the code/ application?


I have developed a complete framework and the code for the Max and OTGw is just a small part. Sharing this code only will be of no use and I did not plan to open source the framework. If you are more specfic what you are after, maybe I can help you.
Rene.
User avatar
Rene
Global Moderator
Global Moderator
 
Posts: 1689
Joined: October 2008
Location: Netherlands

Is ELV Max! a reliable system compared to FHT80b (or ZWAVE)

Postby Rene » Wed Dec 18, 2013 6:15 pm

@pbrand I use the message format linked to by Digit, https://github.com/maartendamen/DomoMQTT/wiki
Rene.
User avatar
Rene
Global Moderator
Global Moderator
 
Posts: 1689
Joined: October 2008
Location: Netherlands

Re: Is ELV Max! a reliable system compared to FHT80b (or ZWAVE)

Postby pbrand » Thu Dec 19, 2013 9:18 am

Rene wrote:@pbrand I use the message format linked to by Digit, https://github.com/maartendamen/DomoMQTT/wiki


Okay, thanks for the update. I looked at the url and though it is very helpful and a good starting point, it doesn't explain anything about why the structure has been chosen the way it is :(

But it's a good food for thought :)
pbrand
Member
Member
 
Posts: 100
Joined: October 2008
Location: Netherlands

Re: Is ELV Max! a reliable system compared to FHT80b (or ZWAVE)

Postby MarnixT » Sat Dec 28, 2013 5:29 pm

I'm experimenting a little and trying to use Domoticz as a frontend for MQTT. After some hard work I was able to install nodejs and get it to work. Knowing not too much about linux, javascript etc. it took me quite a while.
So this allows me to subscribe Domoticz to a particular topic and show the results (still in an experimental phase).

Anyway, the main benefit of MQTT as I understand is to separate the "device driver" from the message bus and the frontend(s). How did you manage to get the events happening in the ELV MAX Cube to be published as a MQTT-topic?

Code: Select all
var h2d = function(h) {
   return parseInt(h,16);
};

var   HID = '3';                                  //Hardware ID of dummy in Domoticz
   IP = '127.0.0.1';                            //IP address of Domoticz (127.0.0.1 for same machine)
   Port = '8080';                              //Port of Domoticz

// for types please refer to http://sourceforge.net/p/domoticz/code/HEAD/tree/domoticz/main/RFXtrx.h
// for Maxbuddy API please refer to http://bugs.maxbuddy.de/projects/maxbuddy/wiki/Buddy_API
var   WMT_dtype1 = '80', WMT_subtype1 = '9';             //WallMountedThermostat Domoticz types for current temperature (temperature , RUBiCSON)
var   HT_dtype1 = h2d('0x50'), HT_subtype1 = '9';       //HeatingThermostat Domoticz types for current temperature (temperature , RUBiCSON)
var   HT_dtype2 = h2d('0x52'), HT_subtype2 = h2d('0xA');    //HeatingThermostat Domoticz types for current temperature (temperature , RUBiCSON)
var   SC_dtype1 = h2d('0x20'), SC_subtype1 = '01';      //ShutterContact

var sys = require('sys');
var net = require('net');
var mqtt = require('./MQTTClient.js');
var request = require('request');

var io  = require('socket.io').listen(5000);
var client = new mqtt.MQTTClient(1883, '127.0.0.1', 'pusher');

var toString = function(text) {
   return text + '';
};


io.sockets.on('connection', function (socket) {
  socket.on('subscribe', function (data) {
    console.log('Subscribing to '+data.topic);
    client.subscribe(data.topic);
  });
});

client.addListener('mqttData', function(topic, payload){
  var DeriveUrl;
 
  sys.puts(topic+'='+payload);
  console.log('listening');
  io.sockets.emit('mqtt',{'topic':String(topic),
    'payload':String(payload)});
 
  DeriveUrl =    'http://'+IP+':'+Port+'/json.htm?type=command&param=udevice&hid='+HID+'&did='+topic+'&dunit='+'1'+'&dsubtype='+HT_subtype1+
            '&dtype='+HT_dtype1+'&nvalue='+'0'+'&svalue='+payload;
  console.log( DeriveUrl);   
  request( DeriveUrl, function (error, response, body) {
  if (!error && response.statusCode == 200) {
    console.log(body) // Print the web page.
  }
  })
});
MarnixT
Starting Member
Starting Member
 
Posts: 42
Joined: November 2012

Re: Is ELV Max! a reliable system compared to FHT80b (or ZWAVE)

Postby MarnixT » Sat Dec 28, 2013 6:21 pm

pbrand wrote:Not quite sure who you are asking this question, Marnix?

Rene I guess
MarnixT
Starting Member
Starting Member
 
Posts: 42
Joined: November 2012

Re: Is ELV Max! a reliable system compared to FHT80b (or ZWAVE)

Postby Rene » Sat Dec 28, 2013 11:22 pm

You have to write some code that talks the Max! Protocol with the cube and publish anything relevant using mqtt.
Rene.
User avatar
Rene
Global Moderator
Global Moderator
 
Posts: 1689
Joined: October 2008
Location: Netherlands

Re: Is ELV Max! a reliable system compared to FHT80b (or ZWAVE)

Postby Digit » Sun Dec 29, 2013 12:27 am

Hi Marnix,

Just to give you an example of what Rene tried to tell you, here's some 'pseudo code' of my Roomba RooWifi 'driver' to help you understand:

Code: Select all
net = require('net');

function start(){
  log("Setting up driver");
  net.createServer(function (socket) {
    socket.on('data', function (data) {
      log("< " + data);
      var obj = JSON.parse(data);
      for(var key in obj.ROOMBA){
        MQTTpublish('roomba/'+key, obj.ROOMBA[key]);
      }
    });

    socket.on('close', function(){
      log("Connection closed");
      process.exit(-1);
    });
  }).listen(8001);
}

start();


This piece of code does nothing more than just publishing everything what (in this case) the RooWifi on top of my Roomba has to offer in terms of information. MQTT has nothing to do with separation, it's a pubsub messaging transport. Separation just comes with that territory. The main point is that if you get some data from the Cube, your code has to break it down into the small(est) pieces and publish every 'interesting item' that can be derived from that data.

BTW, I think this is a bit off topic w.r.t. to the original topic, so maybe you should start your own topic, dedicated to your own questions.
BTW2, I see more MQTT related questions lately, where to post those questions? Maybe it's time for a Software sub-forum dedicated to software tools in general - platforms, frameworks, protocols, ...
BTW3, I don't mind sharing my ELV code, the only thing you have to do is ask for it :wink:
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands

Re: Is ELV Max! a reliable system compared to FHT80b (or ZWAVE)

Postby MarnixT » Sun Dec 29, 2013 11:39 am

Digit wrote:Hi Marnix,

Just to give you an example of what Rene tried to tell you, here's some 'pseudo code' of my Roomba RooWifi 'driver' to help you understand:

This piece of code does nothing more than just publishing everything what (in this case) the RooWifi on top of my Roomba has to offer in terms of information. MQTT has nothing to do with separation, it's a pubsub messaging transport. Separation just comes with that territory. The main point is that if you get some data from the Cube, your code has to break it down into the small(est) pieces and publish every 'interesting item' that can be derived from that data.

Thanks a lot, it makes sense and I also will start rereading your blog posts now that I made some progresssion.
BTW, I think this is a bit off topic w.r.t. to the original topic, so maybe you should start your own topic, dedicated to your own questions.
BTW2, I see more MQTT related questions lately, where to post those questions? Maybe it's time for a Software sub-forum dedicated to software tools in general - platforms, frameworks, protocols, ...

For now I think a general topic discussing MQTT (and everything that comes with it) fits nicely in the software forum. I started a topic for that: viewtopic.php?f=11&t=9238&start=0&hilit=mqtt
BTW3, I don't mind sharing my ELV code, the only thing you have to do is ask for it :wink:

That's very nice of you! Would you be willing to share (some of) your code?
I'm pretty sure I would be able to pull it off using maxbuddy since I already created a direct interface between max buddy and domoticz (domoticz.com/forum/viewtopic.php?f=4&am ... uddy#p4539), but it would be very nice to see how it's done "properly".
MarnixT
Starting Member
Starting Member
 
Posts: 42
Joined: November 2012

Re: Is ELV Max! a reliable system compared to FHT80b (or ZWAVE)

Postby Bwired » Sun Dec 29, 2013 2:11 pm

topic is split and the mqtt stuff is moved to mqtt forum
viewtopic.php?f=81&t=9242
User avatar
Bwired
Administrator
Administrator
 
Posts: 5309
Joined: March 2006
Location: Netherlands

Re: Is ELV Max! a reliable system compared to FHT80b (or ZWAVE)

Postby Digit » Sun Dec 29, 2013 2:55 pm

Hi Marnix,

I don't know whether my way is the "proper" way, but at least it's someones way :wink:

Some additional notes:
The tools module that's being used provides some handy stuff which almost all drivers have in common.
Like getting driver settings from the broker (line 42), an MQTT client (line 36), logging (line 35, to a "logging/elvmax" topic) and filtering/publishing new values to a topic (tools.newValue, line 291).

It should not be that hard to get the script going without that module.
For example, replace tools.log with console.log, hard-code host and port, etc.
In case of questions or problems, I'm here to help ;-)
Attachments
elvmax.zip
(4.48 KiB) Downloaded 383 times
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands

Re: Is ELV Max! a reliable system compared to FHT80b (or ZWAVE)

Postby MarnixT » Mon Dec 30, 2013 1:44 am

thanks a lot. This will take me some time to investigate, pretty impressive stuff.
MarnixT
Starting Member
Starting Member
 
Posts: 42
Joined: November 2012

Re: Is ELV Max! a reliable system compared to FHT80b (or ZWAVE)

Postby MarnixT » Mon Jan 27, 2014 11:53 pm

MarnixT wrote:thanks a lot. This will take me some time to investigate, pretty impressive stuff.

core stuff is working now, thanks Robert!
todo is getting it integrated with domoticz now. I also did some changes to circumvent the tools.js. I think I'll update and improve my own tools.js as well, so I can use your code as much unchanged as possible.

I also noticed something which looked like a S-response. Will post a question in the protocol description topic (viewtopic.php?f=66&t=6654)
MarnixT
Starting Member
Starting Member
 
Posts: 42
Joined: November 2012

Re: Is ELV Max! a reliable system compared to FHT80b (or ZWAVE)

Postby Digit » Tue Jan 28, 2014 12:56 am

YW :)

The first thing that pops up in my mind (don't know why, it just did) is that the last number in the S response has something to do with RF duty cycle, i.e. how 'busy' the Cube is with sending. That's all I can say right now...
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands


Return to MQTT & Node.js

Who is online

Users browsing this forum: No registered users and 1 guest