Panasonic MirAIe integration

Are you getting some sort of error message?

Yes the connection to MQTT is not stable.

1646030657: Socket error on client node-red-ha-miraie-ac-node, disconnecting.
1646030746: New connection from 172.30.32.2 on port 1883.

Hi @milothomas join this groupā€¦

1646035032: Client node-red-ha-miraie-ac-node already connected, closing old connection.
1646035032: New client connected from 172.30.32.1 as node-red-ha-miraie-ac-node (p2, c1, k60, uā€™hassioā€™).
1646035032: New connection from 172.30.32.1 on port 1883.
1646035032: Client node-red-ha-miraie-ac-node already connected, closing old connection.
1646035032: New client connected from 172.30.32.1 as node-red-ha-miraie-ac-node (p2, c1, k60, uā€™hassioā€™).
1646035033: New connection from 172.30.32.1 on port 1883.
1646035033: Client node-red-ha-miraie-ac-node already connected, closing old connection.
1646035033: New client connected from 172.30.32.1 as node-red-ha-miraie-ac-node (p2, c1, k60, uā€™hassioā€™).
1646035033: New connection from 172.30.32.1 on port 1883.
1646035033: Client node-red-ha-miraie-ac-node already connected, closing old connection.
1646035033: New client connected from 172.30.32.1 as node-red-ha-miraie-ac-node (p2, c1, k60, uā€™hassioā€™).
1646035034: New connection from 172.30.32.1 on port 1883.
1646035034: Client node-red-ha-miraie-ac-node already connected, closing old connection.
1646035034: New client connected from 172.30.32.1 as node-red-ha-miraie-ac-node (p2, c1, k60, uā€™hassioā€™).
1646035034: New connection from 172.30.32.1 on port 1883.
1646035034: Client node-red-ha-miraie-ac-node already connected, closing old connection.

@milothomas , thank you for this node. I was searching for Miraie AC integration in home bridge, but could not find any. Now I installed HA and node red for this. However being a noob, Iā€™m struggling to get it work. I dragged the node into a flow and it shows as connected (green tab). What username and password to use in MQTT part? A separate Mqtt broker to be installed?

hey @kingson87, I hadnā€™t seen this till very recently - possibly an update somewhere.

I have fixed this in the 1.0.8 update, could you please update and try again?

hey @drhk10, welcome :slight_smile:!
Apologies for the very sparse documentation.

The MirAIe app talks to an MQTT broker in the cloud for status updates and commands. What this node does is connect to the same broker and relays information and commands to and from HA via your locally hosted MQTT instance that HA talks to - a bridge between the two.

Assuming that you have an MQTT broker that your HA instance connects to - configure the node to use same broker (username and password here are for the broker if you have set one otherwise leave it blank).

Once the node is updated and deployed, you should see a new climate entity in HA - go to Developer Tools and filter for ā€œclimate.ā€

You can use the Thermostat card on your Lovelace dashboard to see the status and send commands.

Hope that helps.

Thank you @ milothomas. sorry for being a total beginner. I installed HA in a raspberry Pi for the sole purpose of getting MirAie Acs in Apple home app (via HA HomeKit integration). So I donā€™t have much idea about HA or node red in general. I have a Homebridge instance running another Pi for other non HomeKit things. MirAie is the only thing not available in Homebridge among my devices.
So now I Have HA on a Pi4, installed Node red add-on. Also installed Mosquitto broker- not configured anything in this. Installed the Miraie node from Manage palette option- dragged the node into node red flow- clicked it to configure- added the configuration entities. Clicked Deploy. Thatā€™s all I cloud figure out. But nothing shows up in the HA dashboard. I know Iā€™m missing things here. Can someone guide me here? Thanksā€¦

Correct me if Iā€™m wrong, but your current set up is as follows

  • HA running on a Pi
  • node-red running on the same Pi
  • Mosquitto broker installed on the same Pi but not yet configured.

Steps:

  1. Get Mosquitto running on the Pi. You can confirm if this working by connecting to it using an mqtt client of your choice.

  2. Add an MQTT integration on HA and configure it to point to the broker you set up in Step 1 (localhost should work)
    image

  3. Open node-red, and configure the mirAIe node that you added to the editor and configure as follows:

    • Mobile & Password - these are the same as the ones you enter on the app on your phone. Remember to add the country code.
    • Host - this is the IP address of the MQTT broker i.e. your Pi - but you should be able to get away with localhost since node-red and Mosquitto are on the same device.
    • Port - the port that is configured in Mosquitto (default: 1883)
    • Username & Password - if you have configured ā€œloginsā€ on Mosquitto use them here. If not leave these blank. See the ā€œdocumentationā€ tab on the Mosquitto add-on to know more.
    • Clean Session & Use SSL/TLS - leave at the default for now.
    • Log Level - Use INFO for now as this will spit out the most info. You can see this on the debug tab after deploying the node.
      image

You should see some log messages on the debug tab in node-red. If you see a ā€œconnectedā€ status on the node, then that should be it.

Now navigate to the ā€œDeveloper Toolsā€ page on HA and filter for ā€œclimateā€, hopefully your devices should be discovered.

Hope that helps, let me know how it goes :slight_smile:

1 Like

Thank you so much for the detailed reply which is very helpful.
I have the HA image installed on the Pi (Not the Pi operating system) by flashing HA image into a memory card. Node red is running in HA as add-on and so is Mqtt broker. I donā€™t have separate instances of these in Pi. So I need to run MQTT separately? The configuration part of Node is correctly done as per your inputs and debug show as devices discovered and connected, but I canā€™t see them in the developer options.

This is good. From the logs it looks like there is an issue connecting to the mqtt broker on the network.

You can run mosquitto as an add-on just like node-red. Were you able to connect to it using a client?

Did you add the mqtt integration? Is that set up correctly?

If possible, post a screenshot of the mosquitto settings as well as the mqtt integration settings.

Hiā€¦I can connect to the MQTT broker from an iPhone client app (just tested)- it says connected.
Yesā€¦I added the MQTT integration. I will share some screen shots of the settings. also attaching the error message in the MQTT logā€¦please go through and correct meā€¦



Could you confirm that the settings you have on the iPhone app and the node-red node are same?

The mosquitto log - is that when the MirAIe node is trying to connect?

You could also try dropping an mqtt-in or mqtt-out node and see if that is able to connect to your broker.
image

Hi,
I added the MQTT in &out nodes and connected. Now I can see the Acs in my developer tools section, but labelled as ā€œunavilableā€. How to make these available and show up on the HA main GUI?



I can add the devices to Lovelace UI, but icons says unavailable. When I click any button, - Failed to call service climate/set_hvac_mode. Service not found. message appears.

Almost thereā€¦ try changing the temp or mode using the app. That should trigger an update.

If that doesnā€™t work, deploy the MirAIe node again - you may have to move the node on the editor for the deploy button to become enabled.

thank youā€¦that worked! Switched on the AC using the MirAie app and restarted nodes. Now all ACs are showing up in the HA as well as iPhone Home app. Thank you for this useful tool. I was looking for this for almost 2 years. Would you be able to make a homebridge integration as well? This works fine though.

:ok_hand: :+1: :+1:

Thanks! Got it to work :slight_smile: Though sometimes goes unavailable for a second here and there while turning off.

Edit 2: Done and working :slight_smile:
The issue was a rather silly one. I had an older mqtt entity with the same name (Panasonic AC) setup via IR.
Deleting that and restarting HA created the new MQTT entry which seems to be working fine now ā€¦

ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”ā€”-

Edit: Was able to install the node after updating node-red.
Node connects fine too:

27/03/2022, 12:46:57node: MirAIe
msg : Object
{ message: "Starting MirAIe node..." }
27/03/2022, 12:46:57node: MirAIe
msg : Object
{ message: "Login successful!" }
27/03/2022, 12:46:57node: MirAIe
msg : Object
{ message: "Discovered 1 devices.", devices: array[1] }
27/03/2022, 12:46:57node: MirAIe
msg : Object
{ message: "HA broker connected." }
27/03/2022, 12:46:58node: MirAIe
msg : Object
{ message: "MirAIe broker connected." }

However I do not see any new entities or devices populated in the entity list.
Am I missing something?


so glad you could get it working @milothomas
Unfortunately i am getting a rc=0 error while trying to installā€¦
Not very familiar with node red but i suppose this indicates there is no release candidate?

Hopefully its a transient error - will try tomorrow again to see how it goes


---------------------------------------------------
2022-03-26T22:31:16.793Z Install : node-red-contrib-ha-miraie-ac 1.0.8

2022-03-26T22:31:17.249Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production [email protected]
2022-03-26T22:31:23.353Z [out] + [email protected]
2022-03-26T22:31:23.353Z [out] updated 1 package in 5.687s
2022-03-26T22:31:23.364Z rc=0

Glad you got it working! Just curious to know which version of node-red you were using before.