Bluetooth LE - Mira Mode Shower

Hi All,

I have a Bluetooth enabled Digital shower, by Mira called Mira Mode. I can control this via an app on my phone.

I can see it in a Bluetooth HCITool Scan, which makes me wonder how hard it would be to integrate as a switch in Home Assistant.

I’ve seen a lot of tracker-type integrations, but has anyone tried something like this before?

1 Like

Simple. Ask the manufacturer for details of their api. Preferably a local one.

Or search github for a python interface.

Did you have any joy getting this working?

Alas no. I don’t have enough knowledge to be able to do this.

I guess it’s not as well-sold as. I thought it would be, so nobody else has really come forward

I don’t understand why, is a brilliant product and no more expensive than a normal shower mixer, set of taps, overflow and waste. It was a no brainer for me.
There will be a way to snuff the Bluetooth packets and make a component but I have no idea where to start

Oldish issue for you, don’t know where it ended up. https://github.com/home-assistant/architecture/issues/74

Hi, I also have a Mira Mode shower, their BLE protocol is straightforward except a CRC control code that took me a bit more to figure out. I use the Mira Mode shower via Home Assistant since more than 1 year and it works great. Here’s the Python module:

https://github.com/alexpilotti/python-miramode

The remaining integration in Home Assistant is done via ssh shell_commands (I use a separate Raspberry PI in BLE range closer to the shower) and template switches.
From there it’s exposed to Alexa / Google Home.

Hi @alexpilotti,
I’m trying to follow your documentation on your Python module in Github but don’t think I’m understanding it correctly.

I run the command pip install -r requirements.txt on my Pi which install the packages as listed in the text file. Now do I put your __init__.py in /configs/python_scripts on the Pi in HA? Where does your example go too?

Sorry for what probably seem like dumb questions.
`

I run those commands in a separate raspberry pi, which is in Bluetooth range to the shower, but you can also run them locally if you prefer, ofc.

shell_command:
  start_shower: '/usr/bin/ssh -o UserKnownHostsFile=/config/ssh/known_hosts -i /your/ssh/id_rsa user@host /usr/bin/python3 ./path/to/start_shower.py'
  stop_shower: '/usr/bin/ssh -o UserKnownHostsFile=/config/ssh/known_hosts -i /your/ssh/id_rsa user@host /usr/bin/python3 ./path/to/stop_shower.py'

And here’s an example for a basic switch:

switch:
  - platform: template
    switches:
      shower:
        value_template: off
        turn_on:
          service: shell_command.start_shower
        turn_off:
          service: shell_command.stop_shower

Hope this helps. Note: the hard part ATM is that, as stated in the README, you need to sniff at least one write packet to figure out the client id, this can be most probably solved by implementing the pairing logic.

Any way to get a sensor in ha to display the shower status?

There is a get_status call in the code Line 77

Thanks, I see that there, looks like it returns the status for each outlet.
I’m not new to ha and learning python, but this is more complex than anything I’ve integrated so far. How would I get this data into ha and into a sensor?

At an educated guess:

  • Write a python script which calls mira.get_state(address) (similar to the example in @alexpilotti’s web page)
  • Call that as a shell_command - (see example above)

Hi @alexpilotti - I don’t suppose you’d be able to provide a bit more guidance on how to obtain the device and client IDs please? I have a Bluefruit LE Sniffer connected to a Pi, and I have Wireshark up and running and able to capture BLE packets. What I can’t find amongst the very busy captures I’m getting are any binary payload packets as you have mentioned when I activate the shower. Where abouts in the packet do you see the 0x11 value? I’m seeing a lot of broadcast traffic, but none directed at my shower itself. I’m also seeing my shower broadcast too. Do you perhaps have a screenshot of the captured packet you used, as seen in Wireshark so as I could get a better idea please? I do have a Mira Activate shower, so that could make a difference, but it would be great to compare against a known good packet! This is my first time sniffing BT in Wireshark so it’s quite new territory to me, although I have used Wireshark to sniff LAN traffic for years.

Also, if you could share your brute force loop code that would be appreciated too. I’m struggling to get my head around that logic just using some sample values!

There have been recent improvements to esphome’s ble components, may be worth a look.

Does anyone know if this would work with Mira Platinum range? Thanks.

Has anyone else sucessfully implemented the Python module for the mode range? I am looking to implement however trying to get my head around it all!

1 Like

I too would love for this to be more straightforward! I have 2x of these and would love them on HA

@Alamapstieks I managed to get it up and running - there is a link to the post here