Espruinohub publish topic format change?

Posted on
  • Hi. I just upgraded my Espruinohub, which was pretty old.

    It used to publish topics in the format ble/advertise/device-name/temp for temperature, for example, but now it only seems to do ble/advertise/mac:address/temp. Is that right? Is there a config option to get that topic back?

    Thanks.

  • Also, I've now got a mix of ble/advertise/mac:address/temp and ble/advertise/mac:address/temperature for different sensors. Everything used to be .../temp before.

  • And all the sensors are listed with their names in the config.json file?

    Do you remember roughly how old your EspruinoHub was before you updated? I know twocolors on GitHub contributed quite a few changes and I guess it's possible one of them broke something, but that was some time ago

    I've now got a mix of ble/advertise/mac:address/temp and ble/advertise/mac:address/temperature for different sensors

    Which sensors report as temperature? Looking at https://github.com/espruino/EspruinoHub/­blob/master/lib/attributes.js#L50-L212 there doesn't seem to be anything that creates a temperature field so I wonder where it comes from? Is it a Xiaomi sensor?

  • My build was about 2 years old, from when I originally committed the Docker image. I've got them configured in the old format, which looks like it ought to still work.

    {
      "12:34:56:78:90": "device-name"
    }
    

    It is picking up the device names, because I still get the ble/advertise/device-name and ble/presence/device-name topics appearing. It's just than none of the individual services (battery, temperature, humidity) have the device name anymore.

    Here's one for my watch battery. There's a 180f topic with the device name, and a battery topic with the MAC address.

    ble/advertise/watch2/180f [48]
    ble/advertise/f9:7f:c4:fd:c4:7f/battery 48
    

    Sounds like this might have been a regression at some point. I think it probably shouldn't publish to the MAC address topics, if you've given the device a name. Or do you think it should do both?

    I'll see if I can have a look into this.

  • RE temperature inconsistency.

    I've got 3 different kinds of sensor. A QingPing ClearGrass CGG1, a Xiaomi LYWSDCGQ, and a few Xiaomi LYWSD03MMC with the custom ATC firmware. It's the first two, the ones with default firmware, that now publish temperature instead of temp.

  • Thanks! I'm not sure what you think about the temperature inconsistency... It's annoying but I wonder whether changing temperature -> temp will end up upsetting others that were expecting it to work that way now :(

    It'd be great if you could see what's up with the topics - I think as you say, if you name a device then we should just use ble/advertise/devicename/... for everything rather than the MAC address - no need to keep sending the other topics with MAC address too.

    For most people that haven't set up the device names list, it should make no effect as the device name won't match anything so it's a pretty safe fix to make

  • I expect you're right. The temperature thing is annoying, but probably not worth changing.

    I found the topics that use the MAC address in the name, and changed them to use device name.
    https://github.com/espruino/EspruinoHub/­pull/109

  • Thanks! Just merged

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

Espruinohub publish topic format change?

Posted by Avatar for user91203 @user91203

Actions