MQTT Plugin

Alles m.b.t. de Homeseer MQTT Broker Plugin van Willem Eradus (Dutch Forum)

Moderator: Willem4ever

MQTT Plugin

Postby Willem4ever » Sat Nov 03, 2012 7:05 pm

Gisteren ben ik begonnen aan de development van een plugin die zich subscribed op een MQTTT broker. Zie hier de eerste screenshot van de plug-in met zeer beperkte functionaliteit - het ontvangen van de P1 data van mijn smartmeter. Als er forum members zijn met interesse dan hoor ik graag waar jullie zoal naar op zoek zijn.

screen-capture.jpg
screen-capture.jpg (280.32 KiB) Viewed 14429 times
User avatar
Willem4ever
Global Moderator
Global Moderator
 
Posts: 804
Joined: October 2006
Location: Uithoorn / Netherlands

Re: MQTT Plugin

Postby Rene » Sat Nov 03, 2012 8:12 pm

Zou mooi zijn als alle status en value changes van andere devices ook naar de broker gestuurt kunnen worden en op deze manier Homeseer te ontsluiten.
Rene.
User avatar
Rene
Global Moderator
Global Moderator
 
Posts: 1689
Joined: October 2008
Location: Netherlands

Re: MQTT Plugin

Postby Digit » Sat Nov 03, 2012 8:33 pm

Mijn 2e gedachte (de 1e staat er al) was om de raw sensor data een format mee te kunnen geven, als in "%3.2f" en dergelijke.
Mooi werk!
User avatar
Digit
Global Moderator
Global Moderator
 
Posts: 3388
Joined: March 2006
Location: Netherlands

Re: MQTT Plugin

Postby Willem4ever » Sun Nov 04, 2012 5:04 pm

Zou mooi zijn als alle status en value changes van andere devices ook naar de broker gestuurt kunnen worden en op deze manier Homeseer te ontsluiten.


Dat zit erin;

/homeseer/floor/room/lampie 60
/homeseer/floor/room/lampie 0
/homeseer/floor/room/lampie 70

/homeseer is nu een vaste default prefix, floor en room zijn de locatie parameters, lampie is de naam van het device.
User avatar
Willem4ever
Global Moderator
Global Moderator
 
Posts: 804
Joined: October 2006
Location: Uithoorn / Netherlands

Re: MQTT Plugin

Postby alias » Tue Jan 21, 2014 11:32 pm

Ziet er goed uit! Is deze MQTT Plugin ook ergens beschikbaar?
alias
Member
Member
 
Posts: 60
Joined: May 2011
Location: Apeldoorn / Netherlands

Re: MQTT Plugin

Postby Phaeton » Wed Jan 22, 2014 6:46 pm

Daar ben ik ook benieuwd naar. Digit maakt mij enthousiast maar mijn programming skills zijn nog niet op het niveau dat ik drivers kan maken. Maar ik gebruik wel homeseer.

Verstuurd vanaf mijn GT-I9300 met Tapatalk
groeten,
Harry
User avatar
Phaeton
Advanced Member
Advanced Member
 
Posts: 568
Joined: May 2010
Location: Wassenaar

Re: MQTT Plugin

Postby raymonvdm » Thu Jan 23, 2014 9:15 am

Ik ben gisteren ook begonnen met onderzoek naar MQTT, de broker is geïnstalleerd en ik kan verbinding maken vanaf een Android client. Ik wil hem gebruiken om vanuit een Asterisk server CallerID te versturen naar HomeSeer

Wanneer komt de plugin beschikbaar ?
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
 
Posts: 1145
Joined: December 2011

Re: MQTT Plugin

Postby alias » Wed Jun 18, 2014 11:33 pm

Ik ben mijn HomeSeer systeem (al enige tijd) aan het migreren naar een systeem op basis van MQTT/Node.js/websockets (he, waar hebben we dat meer gehoord?).
Om 'de winkel open te houden' en toch te kunnen migreren heb ik een plugin geschreven die het mogelijk maakt HomeSeer devices te koppelen aan MQTT topics. (Vergelijkbaar met Willems plugin)
Met deze versie (v0.4) van de plugin is het alleen mogelijk MQTT topic data te ontvangen in HomeSeer. In volgende versies zal het ook mogelijk zijn device aan te sturen of devices MQTT topics te laten updaten.

Veel plezier ermee!

Groet,
Ronald
Attachments
HSPI_MQTT v0.4.zip
HSPI_MQTT v0.4
(30.75 KiB) Downloaded 169 times
alias
Member
Member
 
Posts: 60
Joined: May 2011
Location: Apeldoorn / Netherlands

Re: MQTT Plugin

Postby raymonvdm » Tue Dec 30, 2014 9:40 pm

I also started to fidle around with MQTT (owntracks and broker on Ubuntu Server) and i would like to know how the development is going. I` m currently running Domotiga which is sending me updates about my Youless and would like to add HS2 to the MQTT network to since this is my main domotica system :D

I also installed OpenHAB and and MQTT is running in my test setup. Now i need a way to connect HS2 to OpenHAB using MQTT so i would like to be able to send MQTT messages from HS2
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
 
Posts: 1145
Joined: December 2011

Re: MQTT Plugin

Postby alias » Mon Jan 12, 2015 1:09 am

Een kleine update van de HomeSeer MQTT plugin.
Deze versie publiceert statuswijzigingen van HS devices automatisch in een MQTT topic: homeseer/reference id/status met de nieuwe status en homeseer/reference id/value met de nieuwe waarde.
Enjoy.
Attachments
HSPI_MQTT v0.6.ZIP
(31.63 KiB) Downloaded 180 times
alias
Member
Member
 
Posts: 60
Joined: May 2011
Location: Apeldoorn / Netherlands

Re: MQTT Plugin

Postby Phaeton » Mon Jan 12, 2015 3:36 pm

Very nice, in the future I'll use your plugin to test some stuff. Thanks.
groeten,
Harry
User avatar
Phaeton
Advanced Member
Advanced Member
 
Posts: 568
Joined: May 2010
Location: Wassenaar

Re: MQTT Plugin

Postby raymonvdm » Tue Jan 13, 2015 9:56 am

How can i debug this plugin it does not seems to send/recieve any updates

The log gives me the following warning

13-1-2015 10:29:22 - Warning - 'status' property on device MQTT homeseer/K92/status was accessed - this property has been deprecated and should not be used.

Config

Code: Select all

<?xml version="1.0"?>
<Settings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <MQTTServer>tcp://mqtt.hiddendomain.nl:1883</MQTTServer>
  <HomeSeerRootTopic>homeseer</HomeSeerRootTopic>
  <MQTTClientId>HOME_HS2</MQTTClientId>
  <Mappings>
    <Mapping>
      <DeviceId>B1</DeviceId>
      <TopicName>smartmeter/consumed_low</TopicName>
      <Format>{0:#.##} kWh</Format>
    </Mapping>
    <Mapping>
      <DeviceId>B2</DeviceId>
      <TopicName>smartmeter/consumed_high</TopicName>
      <Format>{0:#.##} kWh</Format>
    </Mapping>
    <Mapping>
      <DeviceId>B3</DeviceId>
      <TopicName>smartmeter/actual_rate</TopicName>
    </Mapping>
    <Mapping>
      <DeviceId>B4</DeviceId>
      <TopicName>smartmeter/actual_consumed</TopicName>
      <Format>{0:#.##} kW</Format>
    </Mapping>
    <Mapping>
      <DeviceId>B5</DeviceId>
      <TopicName>smartmeter/gas</TopicName>
      <Format>{0:#.##} m3</Format>
    </Mapping>
    <Mapping>
      <DeviceId>B6</DeviceId>
      <TopicName>homeseer/K92/status</TopicName>
      <Format>{0:#.##} m3</Format>
    </Mapping>   
  </Mappings>
</Settings>



When i publish a test message to homeseer/K92/status with value "Dit is een test" the HomeSeer device is updated with those values. So reception of values seems to be working but sending status updates by homeseer is not working


Update:

I just learned the name referenceID is not the device CODE but the reference id as stated in the Additional Information Field under the device

Image
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
 
Posts: 1145
Joined: December 2011

Re: MQTT Plugin

Postby alias » Tue Jan 13, 2015 9:04 pm

Hi Raymon,

I know it's a bit odd that you should use the DeviceId for topic subscriptions, while topic publishing uses the ReferenceId. This seems inconsistent, but is due to the fact that both Id's are being used within the topic name and the DeviceId can contain characters which are not allowed (or are reserved) within a MQTT namespace (such as the #, and + characters ).

Of course, if you like, this behavior can be changed quite easily in a future version of the plugin. For example by using a switch in the configuration file: UseReferenceIdInTopic = false, which will use the DeviceId instead of the ReferenceId in the (auto generated) published topic name.

Please also be aware that this version of the plugin does not catch all the status changes. It only catches the status changes of devices which have their Supports Status property set (true). I've noticed that many (third party) scripts and plugins create devices without this property set (false). This ends up HomeSeer ignoring the device (and my plugin also) when it changes its status (or value)... I'm currently investigating an alternative event mechanism which should be able the detect 99% of the device status changes. Now, all I need is some free time ;-)

Regards,
Ronald
alias
Member
Member
 
Posts: 60
Joined: May 2011
Location: Apeldoorn / Netherlands

Re: MQTT Plugin

Postby raymonvdm » Tue Jan 13, 2015 10:19 pm

For now it is working for me :D I get the status updates for my temperature sensors in OpenHAB


Little update:

When the MQTT broker connection is lost due to different reasons (broker restart, connection lost) the MQTT plugin is not reconnecting and gives the following error. Can this be fixed in the plugin?

Code: Select all
In event STATUS_CHANGE callback for plug-in MQTT, object not removed, error: You need to connect to a broker before trying to Publish Source: Microsoft.VisualBasic
Running HS3PRO on PC with Z-Wave / OpenTherm / Plugwise / RFXcom / MQTT / XAP400 / Logitech Media Server and Squeezelite on PI`s
raymonvdm
Senior Member
Senior Member
 
Posts: 1145
Joined: December 2011

Re: MQTT Plugin

Postby geert-jan » Mon May 11, 2015 2:56 pm

Hi,

any plans for a HS3 version of this plugin?

Today my smart meter has been installed, and I am planning to publish the smart meter data using MQTT.
I am running HS3 and a plugin for this Homeseer version will get me up-and-running in little time.

Regards,
Geert-Jan
geert-jan
Member
Member
 
Posts: 125
Joined: November 2010

Next

Return to Homeseer MQTT Plugin Forum

Who is online

Users browsing this forum: No registered users and 1 guest

cron