Announcing MQTT/Android bridging app: Zanzito. Beta testers wanted!

Very interesting app. I’m starting to think already of a lot of interesting applications.

1 Like

Zanzito persistent notification

The app always presents a notification that indicates its current status. This notification is not dismissible and should not be hidden.

Attached to the persistent notification, there are some buttons by which you can start/stop the connection, save a bookmark for your current location and take a picture.

why? I’d use it but not with a persistant notification

Hi, three reasons:

  1. It’s required by Google for all foreground services;
  2. It’s a safeguard against unauthorized installations;
  3. It’s a monitor for the connection status.

I might consider putting in an option in the preferences, not sure how google play store would react though…

I’ll run some tests.

gl

Hello,
This is a feature request
Can you please add support for FIND which basically scans the wifi arround the phone and sends the fingerprints to a server to identify and pinpoint the phone with good accuracy.
At present I run Owntracks, Find(Room+) and Zanzito on the phone constantly which is a bit of drain on the battery. Owntracks can be replaced with Zanzito if I enable emulation.
This will make Zanzito and FIND more usefull IMHO
Anil

1 Like

Hi,
it’s a very interesting development for Zanzito, thanks for suggesting it.
However, if I’m not wrong, at the moment Find only sends updates through MQTT, but it doesn’t receive them. That’s a problem…

gl

FIND has basic support for receiving MQTT updates
To publish fingerprints, use the channel YOURGROUP/track/USERNAME for tracking or YOURGROUP/learn/USERNAME/LOCATION for learning. The body needs to be a multiple of 14 bytes where the first 12 bytes are the Mac address and the next 2 bytes is the RSSI value (absolute value).
https://www.internalpositioning.com/server/#mqtt-support

1 Like

Great! I completely missed it, sorry!
That’s definitely something I’ll try to add to Zanzito.

gl

Can someone explain how this works?

I have a pi3 with hass, with letsencrypt and duckdns.

I understand little about mqtt. I do have it installed and have this line of code in configuration for a PIR sensor. What can I achieve with this Zanzito?
A step by step guide on how to program it?

mqtt:
  broker: 192.168.1.239
  port: 1883
  client_id: home-assistant-1
  username: username
  password: password

binary_sensor pir_entrance1:
  - platform: mqtt
    state_topic: "/home/hass/.homeassistant/sensor/pir_entrance_one"
    name: "Foyer Light Motion"
    qos: 0
    payload_on: "ON"
    payload_off: "OFF"
    sensor_class: motion

- service: mqtt.publish
  data:
    topic: "/home/hass/.homeassistant/sensor/pir_entrance_one"
    payload: "OFF"
    retain: "true"

Hi, with Zanzito your can receive a notification every time the sensor state changes.
It looks like your PIR sensor is already connected through MQTT, so there’s no need to add automations to HA.
Presuming you have properly configured Zanzito to connect to your MQTT server, and that your PIR sensor correctly publishes its state to an MQTT topic, in Zanzito it would be enough to add a “Report” (i.e. a subscription) inserting the PIR MQTT topic, et voilà: you will receive a notification every time the state changes.

not sure you can see the video. This is what I did, the HASS config is above.
In Zanzito I did:

  1. preferences - mqtt connection . Changed the value in host (192.168.1.239); and Device name (home)
  2. reports - +
    type Text (maybe is this alarm for pir sensor???)
    name Sensor PIR
    Topic /home/hass/.homeassistant/sensor/pir_entrance_one
    android notification ticked

Nothing else.

But I receive no notification

p.s. I have a python script that has
publish.single("/home/hass/.homeassistant/sensor/pir_entrance_one",“ON”,hostname=“localhost”, auth=auth)

Hi, the configuration in Zanzito looks good. Can you confirm that Zanzito connects to the MQTT broker alright?

Can you confirm that the message from the PIR is actually published on the MQTT broker, with mosquitto_sub or any other MQTT tool?

Also, you might want to simplify your topic: trailing “/” are deprecated, and I’m not entirely sure about the “.”
You might want to use something like home/sensors/pir_entrance_one

how to check this?

I will check, please explain how … sorry newb here

Zanzito main notification should read “Connected”, also you can check the logs (menu-> View logs)

perhaps the simplest way is to download the paho client, configure it to connect to your MQTT and then subscribe to the topic from there
But there are tons of MQTT desktop clients

I did this, ok?

In my rf_receive.py file that checks the 433MHz receiver which receives the PIR signal

while True:
    if rfdevice.rx_code_timestamp != timestamp:
        timestamp = rfdevice.rx_code_timestamp
        if str(rfdevice.rx_code) == '971897':
           i = i+1
           logging.info("Detect code " + str(rfdevice.rx_code) + " i=" + str(i))
        if i == 10:
           publish.single("sensor-pir_entrance_one","ON",hostname="localhost", auth=auth)

in configuration.yaml

   - service: mqtt.publish
      data:
        topic: "sensor-pir_entrance_one"
        payload: "OFF"
        retain: "true"

Sorry, wrong link
This one should be ok

Sorry, no, that is not what you need to put in HA configuration.
you must define a binary_sensor:

binary_sensor:
  - platform: mqtt
    name: "PIR"
    state_topic: "sensor-pir_entrance_one"
    payload_on: "ON"
    payload_off: "OFF"
    sensor_class: motion

But this serves for HA only. You don’t need to do anything in HA in order to see the sensor from Zanzito

Sorry yes, I did now also this change

binary_sensor pir_entrance1:
  - platform: mqtt
    state_topic: "sensor-pir_entrance_one"
    name: "Foyer Light Motion"
    qos: 0
    payload_on: "ON"
    payload_off: "OFF"
    sensor_class: motion

trying now, connect failed , not authorized

How to put a username and password?