Page 14 of 16

Re: HS3 MQTT Plugin

Posted: Fri Oct 27, 2017 8:24 pm
by MrMxyzptlk
I'm getting this error with a clean install of the MQTT plugin?

Error Initializing plug-in(2): MQTT Instance::unable to open database fileSTACK: Server stack trace: Exception rethrown at [0]: at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessag e(IMessage reqMsg, IMessage retMsg) at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(Mess ageData& msgData, Int32 type) at HomeSeerAPI.IPlugInAPI.InitIO(String port) at Scheduler.clsHSPI.CheckInterfaces()

Re: HS3 MQTT Plugin

Posted: Mon Oct 30, 2017 9:29 am
by geert-jan
Hi,

which HS3 version and which OS are you using?
Can you check if the following file exists in your HS installation folder: 'Data/HS3MQTT/hs3mqtt.sqlite'. The installer should install this empty database file.
Also check the access right, the HS user should have read/write access to this file.

Thanks in advance,
Geert-Jan

Re: HS3 MQTT Plugin

Posted: Tue Oct 31, 2017 11:54 pm
by dbvanb
Hello Everyone,

I am using the Hometrollerz-s2 (Rasp pi) I am trying to install this plugin on this hometroller, and can't get it to work.
I have read through all of this thread and seen the question asked before, but never a definitive answer.

First, I used the Windows/Linux version of the plugin.
When I initialize the plugin, I get this:

WARNING: Failed getting InterfaceStatus from MQTT - the interface was not found in the list of active interfaces, the list may need to be
refreshed.

The log entry is as follows:
Oct-29 8:08:46 AM Plug-In Finished initializing plug-in MQTT
Oct-29 8:08:46 AM Error Initializing plug-in(2): MQTT Instance::Object reference not set to an instance of an objectSTACK:
at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_remoting_wrapper (intptr,intptr) at (wrapper remoting-invoke)
HomeSeerAPI.IPlugInAPI:InitIO (string) at Scheduler.clsHSPI.CheckInterfaces () <0x7232b340 + 0x00217> in :0
Oct-29 8:07:55 AM Info Plugin MQTT has connected. IP:127.0.0.1:57322

Then I go to configure MQTT plugin and I get no webpage
the log states this:
Oct-29 4:56:10 PM Error Getting web page from plugin page MQTTConfig:Object reference not set to an instance of an object

I then found the RPI version and installed the 2 dlls in the HomeSeer directory, removing the EXE and other dll.
I looked to see that there is a MQTT directory in the DATA directory with a SQL database.

When I used the RPI version with the two dlls, and I get nothing, IE under manage plugins, there is no MQTT to
turn on or off. So I can't see how to use it. I would really like to get this to work.

I have an MQTT broker on one RPI and from the command line in the Hometrollerz, I can subscribe and get that to work,
I'm just not able to install the plugin.

For clarification, the Hometroller-Z s2 runs on the raspberry pi, with the specific homeseer build.
I am currently at HS3 version - 3.0.0.368, which is the latest.
I have 4 plugins, and the MQTT would be the fifth, which is the limit for the hometroller-z. (Why I don't know).
This is a Linux OS, which I am fairly familiar with, as all my home computers are Linux based.

I run:
wxweather
SDJ-health
RaspberryIO
and the Zwave plugin (why that counts as a plugin, again I don't know)
MQTT would be the fifth.
HStouch used to be a plugin, and when it moved to the main program,
I thought this would be an opportunity to add MQTT

I had someone suggest that maybe the HSTouch is still counted as a plugin and I exceed the max.
Any help would be appreciated

Thanks
Bruce

Re: HS3 MQTT Plugin

Posted: Thu Nov 02, 2017 8:41 am
by geert-jan
Hi,

which version of the MQTT plugin are you using?
Can you set the loglevel of the MQTT plugin (via the Config page) to LOGLEVEL_INFO and stop/start the plugin to see what happens. This gives me more data to troubleshoot this issue. Note that you will get a lot of messages in the logfile, so turn off the MQTT logging after a short time.

Regards,
Geert-Jan

Re: HS3 MQTT Plugin

Posted: Thu Nov 02, 2017 8:45 pm
by dbvanb
I tried the version in the download list on the Homeseer sight first. That would not allow me to configure anything, even though I could see it in the manage plugins page to activate or inactivate. When trying to configure it, I would not get any webpages, and the log entry said the page could not be found (see the message above). Then I read this forum that I needed to use the Raspberry version, which I installed (with only the 2 dll files, no exe file). I removed all other files dealing with the previous MQTT version, (except the sql database file in the DATA/MQTT folder). At this point, nothing shows up in the manage plugins page on the Homeseer. I have seen other people mention this, but I am at a loss to know what to do next. With the raspberry pi version, there are no configuration pages to use - to turn on or off anything, ie debug logging.
Thanks for looking at this. Maybe I just missed something
Bruce

Re: HS3 MQTT Plugin

Posted: Fri Nov 03, 2017 8:25 am
by geert-jan
Hi,

you used the RPi version from this thread? That version is quite outdated and I do not know if it still works with the current homeseer version. Also that version has limited logging and configuration capabilities.

Better install the plugin via homeseer. If you are not able to adjust the loglevel via the config page of the MQTT plugin:
- look for the mqtt.ini file in the HS3 folder
- there should be an entry "INI_MQTT_LOGLEVEL = LOGLEVEL_NONE"
- change this to "INI_MQTT_LOGLEVEL = LOGLEVEL_NONE" (without the quotes)

Regards,
Geert-Jan

Re: HS3 MQTT Plugin

Posted: Sun Nov 05, 2017 5:41 am
by dbvanb
Ok here is what I have done:
Removed all the files for both the rpi version of the plugin from this thread and the one I previously installed from Homeseer.

Reinstalled the version in the Homeseer plugin page/site ( under lilghting and technology.
Log:
Nov-04 6:13:27 PM Updater Install/Update of package MQTT was successful.
Nov-04 6:13:27 PM Updater Copying file: \usr\local\HomeSeer\Data\HS3MQTT\hs3mqtt.sqlite
Nov-04 6:13:27 PM Updater Making dir: \usr\local\HomeSeer\Data\HS3MQTT\
Nov-04 6:13:27 PM Updater Copying file: \usr\local\HomeSeer\M2Mqtt.dll
Nov-04 6:13:27 PM Updater Copying file: \usr\local\HomeSeer\HSPI_MQTT.exe.config
Nov-04 6:13:27 PM Updater Copying file: \usr\local\HomeSeer\HSPI_MQTT.exe
Nov-04 6:13:26 PM Updater Installing package MQTT
Nov-04 6:13:26 PM Updater Update HSPI_MQTT.exe downloaded successfully
Nov-04 6:13:26 PM Updater Downloading update: MQTT
Nov-04 6:13:26 PM Warning Update is not configured properly in updater.txt file, missing interface name.
Nov-04 6:13:26 PM Updater Starting download of updates

on initialization:

WARNING: Failed getting InterfaceStatus from MQTT - the interface was not found in the list of active interfaces, the list may need to be refreshed.

Log:
Nov-04 9:11:13 PM Plug-In Finished initializing plug-in MQTT
Nov-04 9:11:13 PM Error Initializing plug-in(2): MQTT Instance::Object reference not set to an instance of an objectSTACK: at (wrapper managed-to-native) System.Object:__icall_wrapper_mono_remoting_wrapper (intptr,intptr) at (wrapper remoting-invoke) HomeSeerAPI.IPlugInAPI:InitIO (string) at Scheduler.clsHSPI.CheckInterfaces () <0x72a14788 + 0x00217> in :0
Nov-04 9:10:22 PM Info Plugin MQTT has connected. IP:127.0.0.1:53338

Under config:
http://10.x.x.xxx/MQTTConfig - no response - blank page
Log:
Nov-04 9:13:05 PM Error Getting web page from plugin page MQTTConfig:Object reference not set to an instance of an object

mqtt.ini - not found in:
/usr/local/HomeSeer/Config
/usr/local/HomeSeer
created it and put the line:
INI_MQTT_LOGLEVEL = LOGLEVEL_NONE
restarted the plugin after creating this file - no change, same message as above

Contents of HSPI_MQTT.EXE.config:

<?xml version="1.0"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<probing privatePath="bin;Bin" />
</assemblyBinding>
</runtime>
</configuration>

So a couple of thoughts:
is this a problem?
Nov-04 6:13:26 PM Warning Update is not configured properly in updater.txt file, missing interface name.

The other thing I see is the web address:
http://10.x.x.xxx/MQTTConfig - which is the web page to configure the plugin
This isn't in the html folder in the HomeSeer folder.
Under linux this would be in :
/use/local/HomeSeer/html thus /use/local/HomeSeer/html/MQTTConfig (a file in the folder, I assume)

and again no mqtt.ini in the Homeseer directory folder

So I am stuck at this point. Any suggestions?
Thanks
Bruce

Re: HS3 MQTT Plugin

Posted: Mon Nov 13, 2017 9:58 am
by geert-jan
Hi,

strange issue; I could not reproduce this in my homeseer test virtual machine (which probably differs from a RPi2 set-up, which I do not have available at the moment).

The mqtt.ini file is not part of the installation, it is created when the plugin is started.
To enable debug logging create mqtt.ini in the Config folder and add this:

Code: Select all

[Config]
Loglevel = LOGLEVEL_INFO
Please try again with this configuration, probably I get more detailed logging which points me to the real problem.

Can you verify if the bin folder contains the following files:
SQLite.Interop.dll
System.Data.SQLite.dll

These files should be part of the HS3 installation, and are mandatory for the MQTT plugin.

Another possibility is that maybe something is wrong in the RPi2 updater.txt file, but that should be visible on the plugin installer page.

All webpages for the MQTT plugin are dynamically generated, you won't find them on your system.

Regards,
Geert-Jan

Re: HS3 MQTT Plugin

Posted: Mon Nov 13, 2017 10:08 pm
by dbvanb
Hi,

Ok I got it to work.
Here's how:
/usr/local/HomeSeer/bin did not contain SQLite.Interop.dll
added both sqlite files from a post by Pete - SQLStuff.zip

rebooted no luck, until I remembered a post by Eman:
>Your issue looks a bit similar to the earlier posts above. Can you please redirect all installation related >questions here : viewtop...0525&start=195
>
>The plugin author commented on user rights. ( Not using his own words )I would say if you want to avoid problems on >Windows Servers because of user rights when installing HomeSeer, install it for everyone (every user) not >administrator only!

I had to give write permission on hs3mqtt.sqlite in /usr/local/HomeSeer/Data/HS3MQTT
Restarted the plugin with success!

Keys are:
needing SQLite.Interop.dll System.Data.SQLite.dll. On my system the SQLite.Interop.dll wsa missing
in /usr/local/HomeSeer/bin
then write permission is needed on hs3mqtt.sqlite
in /usr/local/HomeSeer/Data/HS3MQTT.

I also upgraded Mosquitto from 1.3 to 1.4, but I am not sure that was needed.

Thanks for the response, that is what led to getting it to work.

Bruce

Re: HS3 MQTT Plugin

Posted: Thu Nov 16, 2017 11:27 pm
by Fredrick
I'm having a strange issue where I'm loosing items that I want to have published. It seems to start with one, then just drop another and then another. Havent really found a system in the chaos.

Unfortunately nothing in the logs other than "Info: Publish" during the times where I experience drops.

Any clue?

HS3 running on a Windows 7 VM on top of Unraid.

Re: HS3 MQTT Plugin

Posted: Sat Nov 18, 2017 3:37 pm
by Fredrick
I'm having a strange issue where I'm loosing items that I want to have published. It seems to start with one, then just drop another and then another. Havent really found a system in the chaos.

Unfortunately nothing in the logs other than "Info: Publish" during the times where I experience drops.

Any clue?

HS3 running on a Windows 7 VM on top of Unraid.

Re: HS3 MQTT Plugin

Posted: Wed Nov 22, 2017 9:10 am
by geert-jan
Hi,

difficult to say with limited information.
Can you check the logging of the MQTT broker? Maybe the connection with the broker (or its clients) gets lost.

Also check the configuration of the MQTT plugin; the QoS for publish is per default set to 'Exactly once'; the message is delivered only one time, with no confirmation.

Regards,
Geert-Jan

Re: HS3 MQTT Plugin

Posted: Wed Nov 22, 2017 11:41 am
by Fredrick
geert-jan wrote:Hi,

difficult to say with limited information.
Can you check the logging of the MQTT broker? Maybe the connection with the broker (or its clients) gets lost.

Also check the configuration of the MQTT plugin; the QoS for publish is per default set to 'Exactly once'; the message is delivered only one time, with no confirmation.

Regards,
Geert-Jan
Any way to turn of the "posts has to be approved" on this forum? I just waited 5 days for my post to be approved..

And I know its very limited information, unfortunately, I dont have much more to go on myself. Due to the high amount of services using MQTT the broker-log is pretty flooded. As long as I dont have a way to consistently reproduce the issue I cant sit and scan the log every 15 minutes.

However, I dont think its an issue with the broker. The devices themself are dropped from the "publish" config page of the plugin. One day I see the items are set up to publish, and its working fine. The next day I log back in and maybe 5 out of 35 devices are no longer set to publish. Due to this I dont think it has to do with the QOS either as its no longer set to publish these devices. QOS is set to exactly once.

I'm the only user, so there is no one else tampering.

Re: HS3 MQTT Plugin

Posted: Wed Nov 22, 2017 1:07 pm
by mushudog
Hello!
I am trying to use your plugin with the following setup:
HS3
MQTT Plugin
Mosquitto Broker
Sonoff switches with Tasmota Firmware
(all latest versions as of today)

I created a virtual device in HS and I am able to control it on/off values using cmnd/topic/POWER

However, when I switch the device off or on from the physical button I need a way to update the status on the virtual device .
I see other topics (stat) that are sending these details for the device via MQTT- I need to link them somehow to the virtual device.

Can somebody point me in the right direction?

Thanks

Re: HS3 MQTT Plugin

Posted: Mon Nov 27, 2017 3:51 pm
by taylormia
Here is a link to a post in the HomeSeer Forums with a guide to integrate the Sonoff S20 Smart Socket with HS3 using the MQTT Plugin and Tasmota firmware. Hope you find this useful.
https://forums.homeseer.com/showpost.ph ... stcount=60