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

Post Reply
pbrand
Member
Member
Posts: 100
Joined: Wed Oct 01, 2008 10:17 pm
Location: Netherlands
Contact:

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

Post by pbrand »

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!
User avatar
Rene
Global Moderator
Global Moderator
Posts: 1689
Joined: Wed Oct 08, 2008 3:54 pm
Location: Netherlands

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

Post by Rene »

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: Wed Oct 08, 2008 3:54 pm
Location: Netherlands

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

Post by Rene »

@pbrand I use the message format linked to by Digit, https://github.com/maartendamen/DomoMQTT/wiki
Rene.
pbrand
Member
Member
Posts: 100
Joined: Wed Oct 01, 2008 10:17 pm
Location: Netherlands
Contact:

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

Post by pbrand »

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 :)
MarnixT
Starting Member
Starting Member
Posts: 42
Joined: Thu Nov 22, 2012 1:45 am

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

Post by MarnixT »

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: Thu Nov 22, 2012 1:45 am

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

Post by MarnixT »

pbrand wrote:Not quite sure who you are asking this question, Marnix?
Rene I guess
User avatar
Rene
Global Moderator
Global Moderator
Posts: 1689
Joined: Wed Oct 08, 2008 3:54 pm
Location: Netherlands

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

Post by Rene »

You have to write some code that talks the Max! Protocol with the cube and publish anything relevant using mqtt.
Rene.
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

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

Post by Digit »

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:
MarnixT
Starting Member
Starting Member
Posts: 42
Joined: Thu Nov 22, 2012 1:45 am

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

Post by MarnixT »

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: http://www.domoticaforum.eu/viewtopic.p ... 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".
Bwired
Administrator
Administrator
Posts: 4704
Joined: Sat Mar 25, 2006 1:07 am
Location: Netherlands
Contact:

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

Post by Bwired »

topic is split and the mqtt stuff is moved to mqtt forum
http://www.domoticaforum.eu/viewtopic.php?f=81&t=9242
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

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

Post by Digit »

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 812 times
MarnixT
Starting Member
Starting Member
Posts: 42
Joined: Thu Nov 22, 2012 1:45 am

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

Post by MarnixT »

thanks a lot. This will take me some time to investigate, pretty impressive stuff.
MarnixT
Starting Member
Starting Member
Posts: 42
Joined: Thu Nov 22, 2012 1:45 am

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

Post by MarnixT »

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 (http://www.domoticaforum.eu/viewtopic.php?f=66&t=6654)
Digit
Global Moderator
Global Moderator
Posts: 3388
Joined: Sat Mar 25, 2006 10:23 am
Location: Netherlands
Contact:

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

Post by Digit »

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...
Post Reply

Return to “MQTT & Node.js”