Re: [mh] MH and MQTT, current state?

Brian M <[email protected]> Fri, 1 Sep 2023 23:29:21 -0700
Newsgroups gmane.comp.misc.misterhouse.user
Message-ID <[email protected]>
Dave,

mqtt_LocalItem looks exactly like what I want. Thanks so much for 
pointing me to that.

I'm having some problems getting it to go, however. There's something 
basic I'm missing here, but I haven't been able to find it. On start-up, 
I'm receiving:

Startup error on &mqtt::server_startup('mqtt'): Undefined subroutine 
&mqtt::server_startup called at (eval 169) line 1.
     main::__ANON__("Undefined subroutine &mqtt::server_startup called 
at (eval 16"...) called at (eval 169) line 1
     eval '&mqtt::server_startup(\'mqtt\')' called at /home/mh/mh/bin/mh 
line 978

Later I see errors where it's trying to publish statuses, but reporting 
that the server isn't connected. So it knows it should publish and 
where, which is good at least.

My mh.private.ini contains:

   mqtt_host=mqttserver
   mqtt_server_port=1883
   mqtt_user=misterhouse
   mqtt_password=nothisisntreallymypassword
   mqtt_keepalive=120


And my items.mht contains:

   MQTT_BROKER, mqttserver,     ,                                   
1883, misterhouse,      thisisntiteither,         121,
   MQTT_LOCALITEM,       shop_light, Shop,                            
mqttserver,     switch, ha/mh/shop/+,               1,
   MQTT_LOCALITEM,       garage_light, Garage,                        
mqttserver,     switch, ha/mh/garage/+,            1,
   MQTT_LOCALITEM,       ceiling,             Family_Room_Ceiling, 
mqttserver,     switch,         ha/mh/family_room/+,    1,
   MQTT_LOCALITEM,       lamps,              Family_Room_Lamps, 
mqttserver,     switch,         ha/mh/family_room/+,    1,

I wasn't quite sure where specify the necessary Perl modules, but I 
placed the following in a user code file I use for declarations:

   use mqtt;
   use mqtt_items;

I've tried both a DNS name and an IP address for the MQTT broker/server, 
but it doesn't seem to make any difference.

Can you tell me what I missed?

-Brian M.

On 9/1/23 09:04, Dave Neudoerffer wrote:
> Hey Brian,
>
> A couple years ago I implemented a bunch of mqtt stuff in 
> mqtt_items.pm <http://mqtt_items.pm>. What you want is mqtt_LocalItem. 
> Read the doc in the .pm file.  If you have any questions, give me a 
> shout.
>
> Dave
>
> On Fri, Sep 1, 2023, 12:21 AM Brian M 
> <[email protected]> wrote:
>
>     Greetings, all.
>
>     I'm looking at connecting MH to my MQTT broker. I'm primarily
>     interested
>     at the moment in publishing each time there is a state changes to
>     one of
>     my Insteon devices. It doesn't appear there's anything inherent in MH
>     that does that. If that's right, would a good solution be to add a
>     tie_event to each Insteon device and provide code to publish the new
>     state when the event occurs? Are there better approaches?
>
>     Thanks in advance, everyone.
>
>                     -Brian M
>
>
>
>     ________________________________________________________
>     To unsubscribe from this list, go to:
>     https://lists.sourceforge.net/lists/listinfo/misterhouse-users
>

________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users