Tasshack / dreame-vacuum

Home Assistant integration for Dreame robot vacuums with map support
https://community.home-assistant.io/t/custom-component-dreame-vacuum
MIT License
898 stars 113 forks source link

Send notification to phone? #527

Closed jockebq closed 6 months ago

jockebq commented 6 months ago

I disabled the notifications from this integration in Home Assistant and started creating my own automations for each notification. But I noticed there are many different scenarios to create an automation for. Is it possible to send all the notifications built into this integration directly to an iOS-phone while having it disabled in Home Assistant?

I feel it is unnecessary to redo all the work you already did for this in separate automations.

Tasshack commented 6 months ago

Checkout the events. https://github.com/Tasshack/dreame-vacuum/blob/master/docs/events.md

jockebq commented 6 months ago

Yes, that's what I am using to create the automations to send notifications. But you have already built a notification system which uses the built in functionality of Home Assistant. Is it possible to transfer all these messages to iOS-notifications, with the text and everything? Without having to create one for each event?

Tasshack commented 6 months ago

No, it is not possible without integration knowing the device id that notification will be send to.

nichtmax commented 5 months ago

Had the same problem and found a way, maybe that helps:

alias: Robi Error Notification
description: ""
trigger:
  - platform: state
    entity_id:
      - sensor.xiaomi_robot_vacuum_x10_error
condition:
  - condition: not
    conditions:
      - condition: state
        entity_id: sensor.xiaomi_robot_vacuum_x10_error
        state:
          - remove_mop
          - no_error
action:
  - service: notify.iphones
    metadata: {}
    data:
      title: Robi will was
      data:
        tag: robi
        mode: only_home_then_away
      message: >
        {% set mapper =  {
          "unknown": "Unknown error code",
          "no_error": "No error",
          "drop": "Wheels are suspended",
          "cliff": "Cliff sensor error",
          "bumper": "Collision sensor is stuck",
          "gesture": "Robot is tilted",
          "bumper_repeat": "Collision sensor is stuck",
          "drop_repeat": "Wheels are suspended",
          "optical_flow": "Optical flow sensor error",
          "no_box": "Dust bin not installed",
          "no_tank_box": "Water tank not installed",
          "water_box_empty": "Water tank is empty",
          "box_full": "The filter not dry or blocked",
          "brush": "The main brush wrapped",
          "side_brush": "The side brush wrapped",
          "fan": "The filter not dry or blocked",
          "left_wheel_motor": "The robot is stuck, or its left wheel may be blocked by foreign objects",
          "right_wheel_motor": "The robot is stuck, or its right wheel may be blocked by foreign objects",
          "turn_suffocate": "The robot is stuck, or cannot turn",
          "forward_suffocate": "The robot is stuck, or cannot go forward",
          "charger_get": "Cannot find base",
          "battery_low": "Low battery",
          "charge_fault": "Charging error",
          "battery_percentage": "Battery level error",
          "heart": "Internal error",
          "camera_occlusion": "Visual positioning sensor error",
          "move": "Move sensor error",
          "flow_shielding": "Optical sensor error",
          "infrared_shielding": "Infrared shielding error",
          "charge_no_electric": "The charging dock is not powered on",
          "battery_fault": "Battery error",
          "fan_speed_error": "Fan speed sensor error",
          "left_wheell_speed": "Left wheel may be blocked by foreign objects",
          "right_wheell_speed": "Right wheel may be blocked by foreign objects",
          "bmi055_acce": "Accelerometer error",
          "bmi055_gyro": "Gyro error",
          "xv7001": "Gyro error",
          "left_magnet": "Left magnet sensor error",
          "right_magnet": "Right magnet sensor error",
          "flow_error": "Flow sensor error",
          "infrared_fault": "Infrared error",
          "camera_fault": "Camera error",
          "strong_magnet": "Strong magnetic field detected",
          "water_pump": "Water pump error",
          "rtc": "RTC error",
          "auto_key_trig": "Internal error",
          "p3v3": "Internal error",
          "camera_idle": "Internal error",
          "blocked": "Cleanup route is blocked, returning to the dock.",
          "lds_error": "Laser distance sensor error",
          "lds_bumper": "Laser distance sensor bumper error",
          "filter_blocked": "The filter not dry or blocked",
          "edge": "Edge sensor error",
          "carpet": "Please start the robot in non-carpet area.",
          "laser": "The 3D obstacle avoidance sensor is malfunctioning.",
          "ultrasonic": "The ultrasonic sensor is malfunctioning.",
          "no_go_zone": "No-Go zone or virtual wall detected.",
          "route": "Cleanup route is blocked.",
          "restricted": "Detected that the vacuum-mop is in a restricted area.",
          "remove_mop": "Mopping completed. Please remove and clean the mop in time.",
          "mop_removed": "The mop pad comes off during the cleaning task.",
          "mop_pad_stop_rotate": "The mop pad has stopped rotating.",
          "bin_full": "The dust collection bag is full, or the air duct is blocked.",
          "bin_open": "The upper cover of auto-empty base is not closed, or the dust collection bag is not installed.",
          "water_tank": "The clean water tank is not installed.",
          "dirty_water_tank": "The dirty water tank is full or not installed.",
          "water_tank_dry": "Low water level in the clean water tank, please fill with water timely.",
          "dirty_water_tank_blocked": "Dirty water tank blocked.",
          "dirty_water_tank_pump": "Dirty water tank pump error.",
          "mop_pad": "The washboard is not installed properly.",
          "wet_mop_pad": "The water level of the washboard is abnormal, please clean the washboard timely.",
          "clean_mop_pad": "The cleaning task is complete, please clean the mop pad washboard.",
          "clean_tank_level": "Check and fill the clean water tank.",
          "station_disconnected": "Base station not powered on",
          "dirty_tank_level": "The water level in the used water tank is too high.",
          "washboard_level": "Water level in the washboard is too high.",
          "no_mop_in_station": "Mop pad is not in the station.",
          "dust_bag_full": "Dust bag is full or vents are blocked." } %}
        {% set x =  states.sensor.xiaomi_robot_vacuum_x10_error.state %} {{
        mapper[x] if x in mapper else 'Failed' }}

mode: single