Re: [mh] MQTT/HomeAssistant
Spencer Ryan <[email protected]> Wed, 4 Dec 2024 22:16:57 -0500
| Newsgroups | gmane.comp.misc.misterhouse.user |
|---|---|
| Message-ID | <CALWY-YqxVuinNRXESpQUoMv_cXFabafRb1s6fXPaZTQEUdMpbQ@mail.gmail.com> |
--===============9099744855438939885==
Content-Type: multipart/alternative; boundary="0000000000005cea8a06287d55d9"
--0000000000005cea8a06287d55d9
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Thanks Giles,
Is there any built in functionality to have status not match the control
object like in the code I shared? For example when HA turns a FanLinc on
it's really going to trigger a scene so that the KPL tied to the FanLinc
also shows correct status, however when reading the status back into HA you
don't want to read the scene, but the device itself.
On Wed, Dec 4, 2024 at 6:05=E2=80=AFPM Giles Godart-Brown <ggodartbrown@gma=
il.com>
wrote:
> The bidirectional bit between Misterhouse and Home Assistant via MQTT is
> included in the latest master release.
> Your items.mht looks like this, (substitute your IP addresses and HA API
> key)
>
>
> #########################################################################=
################################
> # HA set up
>
> #########################################################################=
################################
> # HA_SERVER, obj name, address, keepalive, api_key
> HA_SERVER, ha_house, 999.999.999.999:8123, 10,
> .............your api key from HA ...................
>
>
> #########################################################################=
################################
> # MQTT setup
>
> #########################################################################=
################################
> MQTT_BROKER, mqtt_1, , 999.999.999.999
> MQTT_DISCOVERY, mqtt_disc_mqtt1, homeassistant, mqtt_1, publish
>
> So if you have any item in Misterhouse you will need an MQTT_LOCALITEM,
> then Misterhouse will sync this bi-directionally with HA,
>
> GENERIC, Lounge_comfort_temp, Lounge|Comfort_temp
> #MQTT_LOCALITEM, <mh-mqtt-object>, <mh-object-to-sync>,
> <mh-mqtt-broker-object>, <ha object type>,
> <node-id>/<mh-object-to-sync>/+, <discoverable>, <Friendly Name>
> MQTT_LOCALITEM, Lounge_comfort_mqtt, Lounge_comfort_temp, mqtt_1,
> number, mh/Lounge_comfort_temp/+, 1, Lounge Comfort
>
> If you want to see an HA entity in Misterhouse, you will need an HA_ITEM
> like this
>
> #HA_ITEM, object_name, domain[:subtype],
> ha_entity, ha_server, groups, options
> HA_ITEM, Lounge_TV, switch, lounge_tv, ha_house, groups
>
>
> Regards
> Giles
>
>
> On 04/12/2024 21:47, Spencer Ryan wrote:
>
> Neither. Insteon (PLM)-->Misterhouse<--MQTT-->HomeAssistant
>
>
>
> Someone from reddit gave me some code they built to do most of this, and
> I'm about to go down the rabbit hole
>
> Here is the email from the guy along with the code he provided if anyone
> is curious
>
> https://pastebin.com/wRfJYWnV
>
> https://pastebin.com/fumbhVzw
>
> https://pastebin.com/pvYnr37n
>
> https://pastebin.com/378NETi8
>
> https://pastebin.com/L05ax8vf
>
> On Sun, Dec 1, 2024 at 7:43=E2=80=AFAM Giles Godart-Brown <ggodartbrown@g=
mail.com>
> wrote:
>
>> Ryan
>>
>> How are you doing this?
>>
>> Device > MQTT > Misterhouse
>>
>> OR
>>
>> Device > MQTT > Home Assistant > Misterhouse
>>
>> If its the former then please see
>> https://github.com/hollie/misterhouse/wiki/Items-mqtt
>>
>> Your items.mht will need something like
>>
>> <snip>
>>
>> ########################################################################=
#################################
>> # MQTT setup
>>
>> ########################################################################=
#################################
>> MQTT_BROKER, mqtt_1, , 192.168.100.64
>> MQTT_DISCOVERY, mqtt_disc_mqtt1, homeassistant, mqtt_1, publish
>>
>>
>> ########################################################################=
#################################
>> # MQTT devices
>>
>> ########################################################################=
#################################
>> MQTT_DEVICE, Workshop_fingerprint, Workshop|tasmota_fingerprint ,mqtt_1,
>> tele/Workshop_fingerprint/SENSOR
>> CODE, $Workshop_fingerprint->{states_casesensitive} =3D 1;
>> </snip>
>>
>> Then every time something publishes a message to tele/Workshop_fingerpri=
nt/SENSOR
>> your MH object Workshop_fingerprint->{state} will be set to the
>> message.
>> You may need to decode this as its likely to be JSON
>>
>> Note you can also use wildcards e.g.
>> <snip>
>> MQTT_DEVICE, MQTT_LWT, , mqtt_1, tele/+/LWT
>> </snip>
>>
>> If its the latter, then you need to use HA_ITEM and MQTT_LOCALITEM
>>
>> Let me know if this helps
>>
>> Giles
>> On 30/11/2024 18:48, Spencer Ryan wrote:
>>
>> A timely email from Giles earlier today.
>>
>> After my house was almost hit by lightning a few months ago and frying a
>> lot of stuff I finally got around to rebuilding my Raspberry Pi's.
>>
>>
>> I'm all Insteon, and I wanted to give HomeAssistant another go
>> after trying it 5+ years ago, spoiler alert, it's Insteon support still =
is
>> awful.
>>
>> I'd like to keep MH doing all of the PLM and scene building work, Someon=
e
>> on reddit gave me some code to interface between the two but I'm looking
>> for some pointers on getting MH set up with MQTT from scratch. I don't s=
ee
>> a lot (or any?) real documentation on it.
>>
>> Any pointers?
>>
>>
>> ________________________________________________________
>> To unsubscribe from this list, go to: https://lists.sourceforge.net/list=
s/listinfo/misterhouse-users
>>
>>
>
--0000000000005cea8a06287d55d9
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Thanks Giles,</div><div><br></div><div>Is there any b=
uilt in functionality to have status not match the control object like in t=
he code I shared? For example when HA turns a FanLinc on it's really go=
ing to trigger a scene so that the KPL tied to the FanLinc also shows corre=
ct status, however when reading the status back into HA you don't want =
to read the scene, but the device itself. <br></div></div><br><div class=3D=
"gmail_quote gmail_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">O=
n Wed, Dec 4, 2024 at 6:05=E2=80=AFPM Giles Godart-Brown <<a href=3D"mai=
lto:[email protected]">[email protected]</a>> wrote:<br></div>=
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
=20
=20
=20
<div>
<font size=3D"4" face=3D"Calibri">The bidirectional bit between
Misterhouse and Home Assistant via MQTT is included in the latest
master release. <br>
Your items.mht looks like this,=C2=A0 (substitute your IP addresses a=
nd
HA API key)<br>
<br>
</font>################################################################=
#########################################<br>
# HA set up<br>
###########################################################################=
##############################<br>
# HA_SERVER,=C2=A0=C2=A0=C2=A0 obj name,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 address,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 keepalive,=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0
api_key=C2=A0 =C2=A0<br>
HA_SERVER,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ha_house,=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0 999.999.999.999:8123, 10,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=
=A0=C2=A0=C2=A0=C2=A0
.............your api key from HA ...................<br>
<br>
###########################################################################=
##############################<br>
# MQTT setup<br>
###########################################################################=
##############################<br>
MQTT_BROKER, mqtt_1, ,=C2=A0=C2=A0=C2=A0 999.999.999.999<br>
MQTT_DISCOVERY, mqtt_disc_mqtt1,=C2=A0=C2=A0=C2=A0 homeassistant, mqtt_=
1, publish<br>
<br>
So if you have any item in=C2=A0 Misterhouse you will need an
MQTT_LOCALITEM, then Misterhouse will sync this bi-directionally
with HA, <br>
<br>
GENERIC,=C2=A0=C2=A0=C2=A0 Lounge_comfort_temp,=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0 Lounge|Comfort_temp<br>
#MQTT_LOCALITEM, <mh-mqtt-object>, <mh-object-to-sync>,
<mh-mqtt-broker-object>, <ha object type>,=C2=A0
<node-id>/<mh-object-to-sync>/+, <discoverable>,
<Friendly Name><br>
MQTT_LOCALITEM, Lounge_comfort_mqtt, Lounge_comfort_temp, mqtt_1,
number,=C2=A0=C2=A0=C2=A0 mh/Lounge_comfort_temp/+, 1, Lounge Comfort<b=
r>
<br>
If you want to see an HA entity in Misterhouse, you will need an
HA_ITEM like this<br>
<br>
#HA_ITEM,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 object_name,=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 domain[:subtype],=C2=
=A0=C2=A0
ha_entity,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=
=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 ha_server,=C2=A0 groups, options=
<br>
HA_ITEM, Lounge_TV, switch,=C2=A0 lounge_tv, ha_house, groups<br>
<br>
<br>
Regards<br>
Giles<br>
<br>
<br>
<div>On 04/12/2024 21:47, Spencer Ryan
wrote:<br>
</div>
<blockquote type=3D"cite">
=20
<div dir=3D"ltr">Neither. Insteon
(PLM)-->Misterhouse<--MQTT-->HomeAssistant
<div><br>
</div>
<div><br>
</div>
<div><br>
</div>
<div>Someone from reddit gave me some code they built to do most
of this, and I'm about to go down the rabbit hole</div>
<div><br>
</div>
<div>Here is the email from the guy along with the code he
provided if anyone is curious</div>
<div><br>
</div>
<div><a href=3D"https://pastebin.com/wRfJYWnV" target=3D"_blank">ht=
tps://pastebin.com/wRfJYWnV</a><br>
<br>
<a href=3D"https://pastebin.com/fumbhVzw" target=3D"_blank">https=
://pastebin.com/fumbhVzw</a><br>
<br>
<a href=3D"https://pastebin.com/pvYnr37n" target=3D"_blank">https=
://pastebin.com/pvYnr37n</a><br>
<br>
<a href=3D"https://pastebin.com/378NETi8" target=3D"_blank">https=
://pastebin.com/378NETi8</a><br>
<br>
<a href=3D"https://pastebin.com/L05ax8vf" target=3D"_blank">https=
://pastebin.com/L05ax8vf</a></div>
</div>
<br>
<div class=3D"gmail_quote">
<div dir=3D"ltr" class=3D"gmail_attr">On Sun, Dec 1, 2024 at 7:43=
=E2=80=AFAM
Giles Godart-Brown <<a href=3D"mailto:[email protected]" =
target=3D"_blank">[email protected]</a>>
wrote:<br>
</div>
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex=
;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p><font size=3D"4" face=3D"Calibri">Ryan</font></p>
<p><font size=3D"4" face=3D"Calibri">How are you doing this?</f=
ont></p>
<p><font size=3D"4" face=3D"Calibri">Device > MQTT >
Misterhouse <br>
</font></p>
<p><font size=3D"4" face=3D"Calibri">OR</font></p>
<p><font size=3D"4" face=3D"Calibri">Device > MQTT > Home
Assistant > Misterhouse</font></p>
<p><font size=3D"4" face=3D"Calibri">If its the former then
please see <a href=3D"https://github.com/hollie/misterhouse=
/wiki/Items-mqtt" target=3D"_blank">https://github.com/hollie/misterhouse/w=
iki/Items-mqtt</a></font></p>
<p><font size=3D"4" face=3D"Calibri">Your items.mht will need
something like</font></p>
<p><font size=3D"4" face=3D"Calibri"><snip><br>
###########################################################################=
##############################<br>
# MQTT setup<br>
###########################################################################=
##############################<br>
MQTT_BROKER, mqtt_1, ,=C2=A0=C2=A0=C2=A0 192.168.100.64<br>
MQTT_DISCOVERY, mqtt_disc_mqtt1,=C2=A0=C2=A0=C2=A0 homeassi=
stant,
mqtt_1, publish</font></p>
<p><font size=3D"4" face=3D"Calibri">##########################=
###########################################################################=
####<br>
# MQTT devices<br>
###########################################################################=
##############################<br>
</font><font size=3D"4" face=3D"Calibri">MQTT_DEVICE,
Workshop_fingerprint, Workshop|tasmota_fingerprint
,mqtt_1, tele/Workshop_fingerprint/SENSOR<br>
CODE,=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0
$Workshop_fingerprint->{states_casesensitive} =3D 1;<br>
</snip></font></p>
<p><font size=3D"4" face=3D"Calibri">Then every time something
publishes a message to </font><font size=3D"4" face=3D"Cali=
bri">tele/Workshop_fingerprint/SENSOR your MH
object </font><font size=3D"4" face=3D"Calibri">Workshop_fi=
ngerprint->{state}
will be set to the message.=C2=A0 <br>
You may need to decode this as its likely to be JSON</font>=
</p>
<p><font size=3D"4" face=3D"Calibri">Note you can also use
wildcards e.g. <br>
<snip><br>
MQTT_DEVICE, MQTT_LWT, , mqtt_1, tele/+/LWT<br>
</snip></font></p>
<p><font size=3D"4" face=3D"Calibri">If its the latter, then yo=
u
need to use HA_ITEM and MQTT_LOCALITEM</font></p>
<p><font size=3D"4" face=3D"Calibri">Let me know if this helps<=
br>
</font></p>
<p><font size=3D"4" face=3D"Calibri">Giles<br>
</font></p>
<div>On 30/11/2024 18:48, Spencer Ryan wrote:<br>
</div>
<blockquote type=3D"cite">
<div dir=3D"ltr">A timely email from Giles earlier today.
<div><br>
</div>
<div>After my house was almost hit by lightning a few
months ago and frying a lot of stuff I finally got
around to rebuilding my Raspberry Pi's.=C2=A0</div>
<div><br>
</div>
<div><br>
</div>
<div>I'm all Insteon, and I wanted to give HomeAssistan=
t
another go after=C2=A0trying it 5+ years ago, spoiler
alert, it's Insteon support still is awful.</div>
<div><br>
</div>
<div>I'd like to keep MH doing all of the PLM and scene
building work, Someone on reddit gave me some code to
interface between the two but I'm looking for some
pointers on getting MH set up with MQTT from scratch.
I don't see a lot (or any?) real documentation on it.=
</div>
<div><br>
</div>
<div>Any pointers?</div>
</div>
<br>
<fieldset></fieldset>
<br>
<fieldset></fieldset>
<pre>________________________________________________________
To unsubscribe from this list, go to: <a href=3D"https://lists.sourceforge.=
net/lists/listinfo/misterhouse-users" target=3D"_blank">https://lists.sourc=
eforge.net/lists/listinfo/misterhouse-users</a>
</pre>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
<br>
</div>
</blockquote></div>
--0000000000005cea8a06287d55d9--
--===============9099744855438939885==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
--===============9099744855438939885==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline
________________________________________________________
To unsubscribe from this list, go to: https://lists.sourceforge.net/lists/listinfo/misterhouse-users
--===============9099744855438939885==--