Using NodeJS as MQTT client for Toon

Everything about software tools, new software development and toolchains. For developers, mostly.

Moderators: marcelr, TheHogNL, Toonz

TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Using NodeJS as MQTT client for Toon

Post by TheHogNL »

HansS wrote: Not sure how it works yet, but I saw that the builtin thermostat app reacts to boiler info changes somehow. Don't know if that's also bound to minute interval polls. But maybe it's not. I believe that the thermostat displays the flame icon this way, and it doesn't take a minute to determine that it needs to be on.
That is also done using their BXT protocol. I am not really understanding it yet due to lack of proper skills but I think BXT is something like MQTT where data is pushed and subscribed to. In the thermostat app their is a section which updates the display value when the data is changed, see this in the file "/qmf/qml/apps/thermostat/ThermostatApp.qml":

Code: Select all

        BxtDatasetHandler {
                id: thermstatInfoDsHandler
                dataset: "thermostatInfo"
                discoHandler: thermstatDiscoHandler
                onDatasetUpdate: onThermostatInfoChanged(update)
        }
Member of the Toon Software Collective
HansS
Starting Member
Starting Member
Posts: 34
Joined: Thu Feb 15, 2018 11:54 pm

Re: Using NodeJS as MQTT client for Toon

Post by HansS »

I'm on version 3.6.3. Will try to get the files from the same source, thanks.

And indeed, I saw the bxt stuff. I've seen other posts on the forum about it. Looks interesting. If that's more realtime, then mqtt becomes more interesting maybe.

BTW, how do you know what's on that repository?
marcelr
Global Moderator
Global Moderator
Posts: 1153
Joined: Thu May 10, 2012 10:58 pm
Location: Ehv

Re: Using NodeJS as MQTT client for Toon

Post by marcelr »

The upgrade software downloads a list of packages as part of the update ;-)
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Using NodeJS as MQTT client for Toon

Post by TheHogNL »

Correct, the packages files are in these three locations:

Code: Select all

wget http://feed.hae.int/feeds/qb2/oe/2.6.36-base-r10-qmf0/Packages.gz
wget http://feed.hae.int/feeds/qb2/oe/2.6.36-R10-h27-no6/Packages.gz
wget http://feed.hae.int/feeds/qb2/ene/4.10.6/Packages.gz
The first one is the base and contains all packages which are available from normal Linux distrubutions, this is where mosquitto packages are found.
The second one should match your kernel version (zie 'uname -a'), and mainly contains kernel related stuff including modules.
The third one should reflect your Toon version and contains Toon related stuff.
Member of the Toon Software Collective
TheHogNL
Forum Moderator
Forum Moderator
Posts: 2125
Joined: Sun Aug 20, 2017 8:53 pm

Re: Using NodeJS as MQTT client for Toon

Post by TheHogNL »

Found a way to poll all RRD values using the /qmf/bin/bxt command.

It is working but I'm not really proud of it 8)
Btw, notice a lot of CurrentElectricityFlow results. That is just because I have too many Fibaro plugs :lol:
And because I don't have OpenTherm a lot of boiler values are NaN or zero.

Code: Select all

eneco-xxx-xxxx:/qmf/bin# grep deviceUuid /qmf/config/config_hcb_rrd.xml | sed 's/[<,>]/,/g' | cut -d, -f7,11 | grep -v placeholder |  while IFS=, read -r f1 f2 ; do /qmf/bin/bxt -c -q $f2 -d $f1  2>&1 |  grep "HBXT_QUERY_RESPONSE" | cut -d\  -f8 ; done

OutsideRate=-2.59
BoilerOpMode=0.00
InternalSetpoint=21.00
LongTermOffset=-0.00
CurrentTemperature=22.91
CurrentSetpoint=21.00
BoilerDhwBurnerHours=NaN
BoilerBurnerHours=NaN
CurrentBoilerReturnTemperature=0.00
CurrentBoilerTemperature=0.00
CurrentBoilerSetpoint=0.00
BoilerPumpStarts=NaN
BoilerSuccesfulBurnerStarts=NaN
BoilerFailedBurnerStarts=NaN
BoilerChPressure=0.00
BoilerDhwBurnerStarts=NaN
HeatingFactor=0.58
CurrentElectricityFlow=678
CurrentElectricityQuantity=2606695
CurrentElectricityQuantity=2726996
CurrentElectricityQuantity=5426441
CurrentElectricityQuantity=5358383
CurrentGasFlow=0
CurrentGasQuantity=1419754
CurrentElectricityQuantity=1198298
CurrentElectricityQuantity=3251669
CurrentElectricityFlow=0
CurrentElectricityQuantity=181800.00
CurrentElectricityFlow=1.00
CurrentElectricityQuantity=1670550.00
CurrentElectricityFlow=343.00
CurrentElectricityFlow=0.00
CurrentElectricityQuantity=67400.00
CurrentElectricityFlow=498
CurrentElectricityQuantity=2215553
ProgramState=1.00
BoilerBurnerMinutes=21532
CurrentElectricityFlow=1.65
CurrentElectricityQuantity=9820.00
CurrentElectricityQuantity=6960.00
CurrentElectricityFlow=20.36
CurrentElectricityFlow=16.30
CurrentElectricityQuantity=3930.00
CurrentElectricityFlow=1.29
CurrentElectricityQuantity=1240.00
Member of the Toon Software Collective
HansS
Starting Member
Starting Member
Posts: 34
Joined: Thu Feb 15, 2018 11:54 pm

Re: Using NodeJS as MQTT client for Toon

Post by HansS »

Nice. Though a bit slow it seems.

From an app, you can subscribe to the thermostat information, and you will get a notification when something has changed, and an xml object with all the latest data. Seems that's the only construct that would make mqtt useful.
I've seen that you can run mosquito , and that you can run it like sort of a daemon, and it will send any stdin as an mqtt message.
Any way to send something from a QT app to an outside process?
glsf91
Member
Member
Posts: 184
Joined: Fri Sep 15, 2017 9:25 pm

Re: Using NodeJS as MQTT client for Toon

Post by glsf91 »

TheHogNL wrote:Found a way to poll all RRD values using the /qmf/bin/bxt command.

It is working but I'm not really proud of it 8)
Btw, notice a lot of CurrentElectricityFlow results. That is just because I have too many Fibaro plugs :lol:
And because I don't have OpenTherm a lot of boiler values are NaN or zero.

Code: Select all

eneco-xxx-xxxx:/qmf/bin# grep deviceUuid /qmf/config/config_hcb_rrd.xml | sed 's/[<,>]/,/g' | cut -d, -f7,11 | grep -v placeholder |  while IFS=, read -r f1 f2 ; do /qmf/bin/bxt -c -q $f2 -d $f1  2>&1 |  grep "HBXT_QUERY_RESPONSE" | cut -d\  -f8 ; done

I tried for an Opentherm CurrentBoilerTemperature value. I saw the corresponding value in RRD is changed at about the same moment when seeing a change in value with bxt.
makkie2002
Member
Member
Posts: 66
Joined: Fri Aug 18, 2017 3:28 pm

Re: Using NodeJS as MQTT client for Toon

Post by makkie2002 »

HansS wrote:That is also done using their BXT protocol. I am not really understanding it yet due to lack of proper skills but I think BXT is something like MQTT where data is pushed and subscribed to.
It seems indeed to be that Quby uses MQTT natively ... https://www.isaac.nl/nl/cases/isaac-case/quby/
Post Reply

Return to “Toon software development”