jimtng / bhyve-mqtt

MQTT Gateway to unofficial Orbit B-Hyve API

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bhyve-mqtt

This app is designed to subscribe to the Orbit B-Hyve API and broadcast the messages out over MQTT topics and is currently a work in progress. Any help is greatly appreciated.

At this point, status and device information should be populated.

To Do

  • Handle commands from MQTT to Orbit API (start/stop watering, settings schedules, etc...)

Usage

cd ./app
cp .env-sample .env
// fill out all the config details
npm install
npm start

Environment Configuration

key description
MQTT_BROKER_ADDRESS MQTT broker URL (eg. mqtt://localhost:1883)
ORBIT_EMAIL Broker user
MQTT_PASSWORD Broker password
MQTT_UPDATE_TOPIC Broker topic for realtime updates from AmbientWeather
MQTT_CONNECT_TOPIC Broker topic for initial connections to the AmbientWeather Realtime socket
MQTT_SUBSCRIBE_TOPIC Broker topic for successful subscription to the realtime API

MQTT Schema

Still a work in progress, this is as it stands now.

Breaking Change

Schema changed from bhyve/{deviceID} to bhyve/device/{deviceID}

Events

  • bhyve/alive - json - We received a token from the bhyve API and should be ready to work
  • bhyve/device/{deviceID}/status - json - If bhyve has an active event, relay this event, else null
  • bhyve/device/{deviceID}/details - json - A ridiculous amount of info, most important is list of zones for the device - RETAINED
  • bhyve/device/{deviceID}/zone/{num} - json - Zone detail
  • bhyve/device/{deviceID}/devices - json - List of devices
  • bhyve/device/{deviceID}/message - json - Relay of event from the API for the device example:
{"event":"change_mode","mode":"manual","program":null,"stations":[],"device_id":"ABC12345","timestamp":"2019-05-05T08:50:06.000Z"}`
  • bhyve/message - json - Relay of event from the API

Commands

  • bhyve/device/{deviceID}/zone/{num}/set - json - { "state": "(ON|on|OFF|off)", "time": 12 } - turns station on/off for n minutes. time is not used/ignored for OFF state but is required for ON state. Examples:
// Sets zone 2 to ON for 20 minutes
bhyve/device/ABC12345/zone/2/set
{ "state": "ON", "time": 20 }
// Sets zone 2 to OFF
bhyve/device/ABC12345/zone/2/set
{ "state": "OFF" }
  • bhyve/device/refresh - casues all devices to refresh details
  • bhyve/device/{deviceID}/refresh - casues individual device to refresh details (not yet implemented)

About

MQTT Gateway to unofficial Orbit B-Hyve API

License:MIT License


Languages

Language:JavaScript 99.2%Language:Dockerfile 0.8%