AaronLionsheep / ShellyMQTT

IndigoDomo Plugin that interfaces with Shelly devices over MQTT.
MIT License
0 stars 0 forks source link

Add support for Shelly Motion #102

Closed AaronLionsheep closed 3 years ago

Highsteads commented 3 years ago
Screenshot 2021-02-24 at 22 36 49
{
  "device": {
    "type": "SHMOS-01",
    "mac": "60A4239753CA",
    "hostname": "shellymotionsensor-60A4239753CA",
    "num_outputs": 0
  },
  "wifi_ap": {
    "enabled": false,
    "ssid": "shellymotionsensor-60A4239753CA"
  },
  "wifi_sta": {
    "enabled": true,
    "ssid": "Highsteads_AC",
    "ipv4_method": "static",
    "ip": "192.168.100.233",
    "gw": "192.168.100.1",
    "mask": "255.255.255.0",
    "dns": "192.168.100.1"
  },
  "mqtt": {
    "enable": true,
    "server": "192.168.100.160:1883",
    "user": "Indigo",
    "id": "shellymotionsensor-60A4239753CA",
    "clean_session": true,
    "max_qos": 0,
    "retain": false,
    "update_period": 3600
  },
  "sntp": {
    "server": "time.google.com",
    "enabled": true
  },
  "login": {
    "enabled": false,
    "unprotected": false,
    "username": "admin",
    "auth_type": "basic",
    "default_username": "admin"
  },
  "pin_code": "QT(F6{",
  "name": "null",
  "fw": "20210211-193341/v1.0.3@770a8cb1",
  "discoverable": true,
  "build_info": {
    "build_id": "20210211-193341/v1.0.3@770a8cb1",
    "build_timestamp": "2021-02-11T19:33:41Z",
    "build_version": "2021021119"
  },
  "cloud": {
    "enabled": false
  },
  "coiot": {
    "enabled": true,
    "update_period": 3600
  },
  "timezone": "Europe/London",
  "lat": <REDACTED>,
  "lng": <REDACTED>,
  "tzautodetect": true,
  "tz_utc_offset": 0,
  "tz_dst": false,
  "tz_dst_auto": true,
  "time": "22:46",
  "sleep_time": 0,
  "motion": {
    "sensitivity": 1,
    "blind_time_minutes": 1,
    "pulse_count": 1,
    "operating_mode": 0,
    "enabled": true
  },
  "tamper_sensitivity": 127,
  "led_status_disable": true,
  "dark_threshold": 100,
  "twilight_threshold": 500,
  "schedule": false,
  "schedule_rules": [],
  "hwinfo": {
    "hw_revision": "dev-prototype",
    "batch_id": 0
  }
}
{
  "wifi_sta": {
    "connected": true,
    "ssid": "Highsteads_AC",
    "ip": "192.168.100.233",
    "rssi": -31
  },
  "cloud": {
    "enabled": false,
    "connected": false
  },
  "mqtt": {
    "connected": true
  },
  "time": "22:54",
  "unixtime": 1614207245,
  "serial": 0,
  "has_update": false,
  "mac": "60A4239753CA",
  "cfg_changed_cnt": 0,
  "sleep_time": 0,
  "actions_stats": {
    "skipped": 0
  },
  "lux": {
    "value": 0,
    "illumination": "dark",
    "is_valid": true
  },
  "sensor": {
    "motion": false,
    "vibration": false,
    "timestamp": 0,
    "active": true,
    "is_valid": true
  },
  "bat": {
    "value": 94,
    "voltage": 4.11
  },
  "charger": false,
  "update": {
    "status": "unknown",
    "has_update": false,
    "new_version": null,
    "old_version": "20210211-193341/v1.0.3@770a8cb1",
    "beta_version": null
  },
  "ram_total": 65536,
  "ram_free": 62916,
  "fs_size": 65536,
  "fs_free": 59696,
  "uptime": 27365,
  "active/sleep_ratio": 0,
  "ps_mode": 1
}
AaronLionsheep commented 3 years ago

Some raw MQTT data:

shellies/shellymotionsensor-60A4239753CA/status {"motion":true,"timestamp":1614208212,"active":true,"vibration":false,"lux":0,"bat":94}
shellies/shellymotionsensor-60A4239753CA/status {"motion":false,"timestamp":0,"active":true,"vibration":false,"lux":0,"bat":94}
shellies/shellymotionsensor-60A4239753CA/status {"motion":true,"timestamp":1614208341,"active":true,"vibration":false,"lux":0,"bat":94}
shellies/shellymotionsensor-60A4239753CA/status {"motion":false,"timestamp":0,"active":true,"vibration":false,"lux":0,"bat":94}
shellies/shellymotionsensor-60A4239753CA/status {"motion":true,"timestamp":1614208443,"active":true,"vibration":false,"lux":0,"bat":94}
shellies/shellymotionsensor-60A4239753CA/status {"motion":false,"timestamp":0,"active":true,"vibration":false,"lux":0,"bat":94}
shellies/shellymotionsensor-60A4239753CA/status {"motion":false,"timestamp":0,"active":true,"vibration":true,"lux":0,"bat":94}
shellies/shellymotionsensor-60A4239753CA/status {"motion":false,"timestamp":0,"active":true,"vibration":false,"lux":0,"bat":94}
shellies/shellymotionsensor-60A4239753CA/status {"motion":true,"timestamp":1614208667,"active":false,"vibration":false,"lux":0,"bat":94}
shellies/shellymotionsensor-60A4239753CA/status {"motion":true,"timestamp":1614208679,"active":false,"vibration":false,"lux":0,"bat":94}
shellies/shellymotionsensor-60A4239753CA/status {"motion":true,"timestamp":1614208728,"active":true,"vibration":true,"lux":343,"bat":94}
shellies/shellymotionsensor-60A4239753CA/status {"motion":true,"timestamp":1614208728,"active":false,"vibration":false,"lux":343,"bat":94}
shellies/shellymotionsensor-60A4239753CA/status {"motion":true,"timestamp":1614208764,"active":false,"vibration":true,"lux":416,"bat":94}
shellies/shellymotionsensor-60A4239753CA/status {"motion":true,"timestamp":1614208767,"active":false,"vibration":true,"lux":416,"bat":94}
shellies/shellymotionsensor-60A4239753CA/status {"motion":true,"timestamp":1614208769,"active":false,"vibration":false,"lux":416,"bat":94}

It appears data is sent over the /status topic and the typical payload is structured like:

{
    "motion": true,
    "timestamp": 1614208769,
    "active": false,
    "vibration": false,
    "lux": 416,
    "bat": 94
}