Hubitat for AUS/NZ Chat

I tasmotised 3 more devices today. Feeling pretty good about it too, since I think I erased the firmware on one, and didnt have a successful write......it was real dodgy there for a while. No lights, no indication it was alive/working. But somehow I got it into pairing/accepting firmware mode, and resurrected it. Lots of guesswork.

Now to fix up my automations. I'm slowly removing 3asmarthome switches.
Also, I took yours(??) advise about getting 3 and 4 gang switches and using the other buttons for automations. Pretty funky.

1 Like

Were you still having problems with the 3A one's Mike? The 5 i have are great so far, i hope they don't go bad haha.

Yeah. I bought some 2 year ago, and more than half have failed in 2 years, some less. Pretty disappointing. Others have no issues.

The zigbee routing, I've found, is rather poor with the early models - not sure about the later ones.

I’ve ordered a ecowitt based on your recommendation. Looking forward to getting going after my old faithful weather station finally gave up. I have no idea how the unit works, but could it receive data from other 433mhz units? I’d like to get a rainwater tank sensor, and buying a 433 unit will be much faster than having to make my own wifi version.

1 Like

What are you moving towards now? The deta ones @ bunnings?

Glad I could help. Are you getting the same model number I quoted? There a couple of variations available, some with LCD screens, etc.

My knowledge of how it works is only based on my own experience, but essentially it has a small matchbox size "hub" that needs to be USB powered and connects to your wifi for sending sensor data, while the ecowitt weather station situated outside, and any other ecowitt sensors, communicate to the hub over RF. Whether other brands of sensors can connect I can't say for sure, but based on what I have seen in the app I wouldn't think so, but I have not researched this. I guess if you are intending to bring the data into HE, then perhaps you could use that as your integration point. Alternatively, ecowitt also supports uploading your ecowitt data to weather underground and other online weather services. If you purchase other non-ecowitt sensors that also integrate with the same service, you may not need your additional sensors to talk back to the ecowitt hub.

When you start to set it up you may want to look here for the driver and other info:

Simon

Yeah. I think I read this week that they failed too. But if they do, Bunnings will take them back. My previous lights - keep on saying: not their responsibility.

2 Likes

I ended up getting gw1002 because I want o mount the anemometer separately from the other sensors. Basically anemometer on a pole as high as I can from the roof and temp and rain at 1.5m. Not quite BOM standard but closer than everything at 1.5 or 6m. I really like that this system gives option to add additional sensors and have them spread out. I figured I didn’t need a monitor if I was going to use it with hubitat dashboard anyway. I checked out those Drivers and looks great. I think the tank sensor will be a long shot, but if it was an open system it may have been possible. Might be making my own wifi version by the looks of it. I’ll do some investigation if anyone on the forums has a good design, there are a few random ones on the web, but something tried and tested is always better. Thanks for the tips. This Aussie thread is gold.

1 Like

Nice mate well done. So glad you decided to go this route it really is pretty easy and it works so well once implemented to.

Yes those "virtual buttons" are what I suggested. I planned it when I built this house so deployed to hallway (no 2way) and loungeroom to turn on/off my lamp and rear Somfy blinds it works so well. I am using the Nues for this but the outcome is the same. Again glad you like it.

1 Like

Not having much luck ay!!

1 Like

So, are those also Nue/Zemismart?

Yeah. I was an early devotee. I brought across the device handlers before they were incorporated into the HE hub itself, and actively petitioned Kevin from 3asmarthome to send samples to Hubitat staff, which he did.

I dont want to bad mouth them now, but that's my experience.

3 Likes

I have 3A’s 2.3.4 gang for about 7 months. No issues here.

Also had 4 3A smart home switches for about 4 months and haven't had an issue yet. Never dropped mesh, always worked with automation.

Hi All,

Yesterday I worked on a BLE to MQTT project that I had planned back in Feb but as I needed parts from China they only arrived recently due to COVID delays etc. Anyways I was looking for a presence fob to put inside my cycling pouch to open the garage door when I arrived on my bike between a specific time of the day. I had tried the Samsung presence fobs before but the battery dies reasonably quickly, you can modify them though to take a bigger battery etc but then it starts getting bulky. Enter BLE ibeacon's, they are inexpensive, tiny and offer decent battery life.

The items I used in this project this Wemos D1 Mini with an ESP32 chip which has bluetooth built in and this tiny BLE fob. The Wemos is then loaded with the below Arduino sketch. You will need an MQTT broker and a flow to wrap intelligence around how you want to use it so I did that all in NodeRed. I did learn yesterday that you can use this as room based presence and configure your mobile phone to act as the BLE device. you'd need 1 Wemos D1 Mini ESP32 per room but effectively you could configure it so when you walk into rooms it knows your there and then completes automation's, or just know where family members are exactly etc. Anyways pretty powerful stuff so I thought i'd share to you lot. btw here is the 3d printed case I used as well.

note: if you do use it for room based presence to adjust the sensitivity just edit the RSSI value e.g. make it smaller to say -80 or whatever you need to know your in that room, the larger you make it the further it will pick you up so just depends on use case.

 * 
 * This detects advertising messages of BLE devices and compares it with stored MAC addresses. 
 * If one matches, it sends an MQTT message to swithc something

   Copyright <2017> <Andreas Spiess>

  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
  to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
  and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  DEALINGS IN THE SOFTWARE.
   
   Based on Neil Kolban's example file: https://github.com/nkolban/ESP32_BLE_Arduino
 */

#include "BLEDevice.h"
#include <WiFi.h>
#include <PubSubClient.h>


static BLEAddress *pServerAddress;

#define LED 22

BLEScan* pBLEScan;
BLEClient*  pClient;
bool deviceFound = false;

String knownAddresses[] = { "fd:XX:XX:XX:XX:bd"};

const char* ssid = "YOURWIFISSID";
const char* password = "YOURWIFPASSWORD";
const char* mqtt_server = "YOURMQTTSERVERIP";  // change for your own MQTT broker address
#define TOPIC "YOURTOPIC"  // Change for your own topic
#define PAYLOAD "arrived"    // change for your own payload

 unsigned long entry;

WiFiClient espClient;
PubSubClient MQTTclient(espClient);

static void notifyCallback(
  BLERemoteCharacteristic* pBLERemoteCharacteristic,
  uint8_t* pData,
  size_t length,
  bool isNotify) {
  Serial.print("Notify callback for characteristic ");
  Serial.print(pBLERemoteCharacteristic->getUUID().toString().c_str());
  Serial.print(" of data length ");
  Serial.println(length);
}

class MyAdvertisedDeviceCallbacks: public BLEAdvertisedDeviceCallbacks {
    /**
        Called for each advertising BLE server.
    */
    void onResult(BLEAdvertisedDevice advertisedDevice) {
      Serial.print("BLE Advertised Device found: ");
      Serial.println(advertisedDevice.toString().c_str());
      pServerAddress = new BLEAddress(advertisedDevice.getAddress());

      bool known = false;
      for (int i = 0; i < (sizeof(knownAddresses) / sizeof(knownAddresses[0])); i++) {
        if (strcmp(pServerAddress->toString().c_str(), knownAddresses[i].c_str()) == 0) known = true;
      }
      if (known) {
        Serial.print("Device found: ");
        Serial.println(advertisedDevice.getRSSI());
        if (advertisedDevice.getRSSI() > -90) deviceFound = true;
        else deviceFound = false;
        Serial.println(pServerAddress->toString().c_str());
        advertisedDevice.getScan()->stop();
      }
    }
}; // MyAdvertisedDeviceCallbacks

void sendMessage() {
  //btStop();
  delay(10);
  // We start by connecting to a WiFi network
  Serial.println();
  Serial.print("Connecting to ");
  Serial.println(ssid);

  WiFi.mode(WIFI_STA);
  WiFi.begin(ssid, password);

  entry = millis();
  while (WiFi.status() != WL_CONNECTED) {
    if (millis() - entry >= 15000) esp_restart();
    delay(500);
    Serial.print(".");
  }
  Serial.println("");
  Serial.print("WiFi connected, IP address: ");
  Serial.println(WiFi.localIP());
  MQTTclient.setServer(mqtt_server, 1883);
  MQTTclient.setCallback(MQTTcallback);
  Serial.println("Connect to MQTT server...");
  while (!MQTTclient.connected()) {
    Serial.print("Attempting MQTT connection...");
    // Attempt to connect
    if (MQTTclient.connect("ESP8266Client", "admin", "admin")) {
      Serial.println("connected");
      MQTTclient.publish(TOPIC, PAYLOAD);
    } else {
      Serial.print("failed, rc=");
      Serial.print(MQTTclient.state());
      Serial.println(" try again in 5 seconds");
      // Wait 5 seconds before retrying
      delay(1000);
    }
  }
  for (int i = 0; i > 10; i++) {
    MQTTclient.loop();
    delay(100);
  }
  MQTTclient.disconnect();
  delay(100);
  WiFi.mode(WIFI_OFF);
  btStart();
}

void MQTTcallback(char* topic, byte* payload, unsigned int length) {
  Serial.print("Message arrived [");
  Serial.print(topic);
  Serial.print("] ");
  for (int i = 0; i < length; i++) {
    Serial.print((char)payload[i]);
  }
  Serial.println();
}

void setup() {
  Serial.begin(115200);
  Serial.println("Starting Arduino BLE Client application...");
  pinMode(LED, OUTPUT);
  digitalWrite(LED, HIGH);

  BLEDevice::init("");

  pClient  = BLEDevice::createClient();
  Serial.println(" - Created client");
  pBLEScan = BLEDevice::getScan();
  pBLEScan->setAdvertisedDeviceCallbacks(new MyAdvertisedDeviceCallbacks());
  pBLEScan->setActiveScan(true);
}

void loop() {

  Serial.println();
  Serial.println("BLE Scan restarted.....");
  deviceFound = false;
  BLEScanResults scanResults = pBLEScan->start(30);
  if (deviceFound) {
    Serial.println("on");
    digitalWrite(LED, LOW);

    sendMessage();
    Serial.println("Waiting for 60 seconds");
    delay(60000);

  }
  else {
    Serial.println("off");
    digitalWrite(LED, HIGH);
  }
} // End of loop
5 Likes

Have ordered a Bond Bridge through Amazon AU, very excited....

2 Likes

Is that an Rf hub? What's the benefit of that over a broadlink rm pro device?

It can do Somfy shades which have a "rolling code"

2 Likes

Nice, i love my bondhome.io it's used multiple times daily for my Somfy shades and it's never skipped a beat. btw if you need a mount for it this is what I use.

1 Like

Thanks, I had seen the mount when you posted about it here. I probably need to come up with some sort of larger solution, starting to acquire a few hubs now... :slightly_smiling_face: