Looking for a Zigbee tag

Xiaomi, Ikea TRÅDFRI, Philips Hue and more.

Moderator: leecollings

manjh
Posts: 729
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Looking for a Zigbee tag

Post by manjh »

I found a way to experiment with traccar at (almost) zero cost, using an old smartphone. Install traccar client on it, and use a large powerbank as backup to the phone battery.
Plug the powerbank into an outlet of the car. This should keep the phone running for a few days when I donot use the car. As soon as the car drives again, power bank will be charged.
As traccar server, I plan to install it on my Synology NAS.

The ideas are there, now all I need to do is execute... :-)
Hans
wvries
Posts: 31
Joined: Sunday 05 March 2017 11:49
Target OS: Raspberry Pi / ODroid
Domoticz version: latest B
Location: Lo Santiago, Murcia, Spain
Contact:

Re: Looking for a Zigbee tag

Post by wvries »

sumitrathore wrote: Friday 29 November 2024 10:55 Hello Everyone,
Has anyone used a low-power Bluetooth tag or beacon with Domoticz for something like this? Can it work as an alternative to Zigbee or ESP devices?

Regards,
Sumit.
I have used the BLE Nut Mini Smart Tracker that worked good, although it does use a lot of batteries (1 per month).
I also "modified" one with a buck converter (12V to 3.2V) and installed in into the car. Works perfect...
manjh
Posts: 729
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Looking for a Zigbee tag

Post by manjh »

I now have traccar-server running on my Raspberry Pi 4, and have installed traccar-client on two Android cell phones, just to play around with the traccar technology.
Also forwarded the incoming messages into Domoticz, so I can use that data to make decisions, and sound the alarm when needed.
I intend to install a 230V power point which I will enable only when my car is in the driveway. Just to make sure other people donot recharge their car at my expense when I'm away!
Also I can then set the a sensor to sound the alarm when the car is "borrowed" by thieves....

I have been playing with this for a day now, looks promising! I think I will now order a tracker, and have it ready to install in my new car.
Hans
BazemanKM
Posts: 35
Joined: Wednesday 22 July 2015 21:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Looking for a Zigbee tag

Post by BazemanKM »

Kedi wrote: Friday 29 November 2024 16:16
In dzVents I convert all data for the right Domoticz device with

Code: Select all

    on = {
      variables = {
          "Location",
      },
    },
A function for the fixTime to 'normal' timestring is

Code: Select all

        local function convertTime(nTime)
            return dz.time.timestampToDate(nTime / 1000, 'yyyy-mm-dd time')
        end
Can you share you're whole DzVents script?
Kedi
Posts: 561
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Looking for a Zigbee tag

Post by Kedi »

No, sorry I can't currently.
It is a big script which is currently not finished yet and full of unwanted comments and skipped parts of the script.
It is for my camper trips to have weather info ahead for the next 300 and 600 km to my destination.
To help you a little bit further I have some snippets put together to a small demo script.

Code: Select all

local NAME = ''
local LATITUDE = 0
local LONGITUDE = 0
local ALTITUDE = 0
local SPEED = 0
local SPEEDLIMIT = 120
local COURSE = 0
local TIME = 0

return {
    active = true,
--      active = false,

    on = {
        timer = {
--          'every minute',
            'at *:01',
        },
            variables = {
                  'Location',
              },
        devices = {
            'Dummy Action',
        },
    },
    logging = {
        level = domoticz.LOG_INFO,
--      level = domoticz.LOG_DEBUG,
        marker = "Traccar-test"
    },
    data = {
        Location = { initial = 'XXXX;51.9;5.5;75.1;120.00;314;1722869616000' },
    },

    execute = function(dz, item)

        -- Data from traccar to Domoticz Location variable
        -- {name};{latitude};{longitude};{altitude};{speed};{course};{fixTime}
        local function fillVars(sValue)
            local t = dz.utils.stringSplit(sValue, ';')
            if #t == 7 then
                NAME = t[1]
                LATITUDE = tonumber(t[2])
                LONGITUDE = tonumber(t[3])
                ALTITUDE = tonumber(t[4])
                SPEED = tonumber(t[5])
                COURSE = tonumber(t[6])
                TIME = tonumber(t[7])
                return 0
            else
                return 1
            end
        end
        local function convertTime(nTime)
            return dz.time.timestampToDate(TIME / 1000, 'yyyy-mm-dd time')
        end

        if (item.isVariable) then
            if not fillVars(item.value) then
                return
            end
        elseif (item.isTimer) or (item.isDevice) then
            if not fillVars(dz.data.Location) then
                return
            end
                        dz.log('================================================================================', dz.LOG_FORCE)
            dz.log('Data of '..NAME..' - '..LATITUDE..' - '..LONGITUDE..' - '..ALTITUDE..' - '..SPEED..' - '..COURSE..' - '..
                TIME..' - '.. convertTime(TIME), dz.LOG_FORCE)
                end
        end
}
Logic will get you from A to B. Imagination will take you everywhere.
BazemanKM
Posts: 35
Joined: Wednesday 22 July 2015 21:39
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Looking for a Zigbee tag

Post by BazemanKM »

Kedi wrote: Wednesday 04 December 2024 18:51 No, sorry I can't currently.
It is a big script which is currently not finished yet and full of unwanted comments and skipped parts of the script.
It is for my camper trips to have weather info ahead for the next 300 and 600 km to my destination.
To help you a little bit further I have some snippets put together to a small demo script.
Thanx, you. Is it posibile to get de lat/long in a custom text? Or switch on/off when traccar device is 5 near the house?
Kedi
Posts: 561
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Looking for a Zigbee tag

Post by Kedi »

You can compare those with the domoticz location, or even calculate the distance between domoticz location and the LATITUDE and LONGITUDE values from the tracker device. The function for that distance is below (ele1 and ele2 are the elevations)

Code: Select all

-- Calculate distance in km using Haversine formula
function calculateDistance(lat1, lon1, lat2, lon2, ele1, ele2)
    if lat1 == nil or lon1 == nil or lat2 == nil or lon2 == nil then
        return nil
    end
    local dLat = math.rad(lat2 - lat1)
    local dLon = math.rad(lon2 - lon1)
    local a = math.sin(dLat/2)^2 + math.cos(math.rad(lat1)) * math.cos(math.rad(lat2)) * math.sin(dLon/2)^2
    local angle = 2 * math.atan(math.sqrt(a), math.sqrt(1 - a))
    local distance = R * angle
    if ele1 ~= nil and ele2 ~= nil then
        -- Add the elevation to the calculation
        local elevation = 0
        elevation = math.abs(ele1 - ele2) / 1000;  --in km
        if (elevation > 0) then
            distance = math.sqrt(elevation^2 + distance^2 )
        end
    end
    return distance     --distance in km
end

Logic will get you from A to B. Imagination will take you everywhere.
manjh
Posts: 729
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Looking for a Zigbee tag

Post by manjh »

I looked a bit more at trackers, and find the ST-901 and ST-905 at alwaysconnected.eu. They are also available from Aliexpress, but there I see quite a few remarks about devices that are advertised for 4g, but in reality only work on 2g.

Which of the two types is better? 901 or 905?
Hans
Kedi
Posts: 561
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Looking for a Zigbee tag

Post by Kedi »

My experiance is only with the ST-901 4G and it works flawless. About 0,5 Mbytes traffic per day stationary and a little bit more when driving.
And it takes around 5-10 mA average at 12 Volt.
This works beter then a Zigbee tag, because you always know where the car is.
I also have an OBD-2 tracker which could be connected to the OBD port of a car. With that I also know when the motor is running.
Problem with 2G and 4G is that people don't read the description well and order the wrong one and complain afterwards.
When you search for "ST-901 4G" both 2G and 4G will be presented, just pick the right one.
The ST-901 might be a better choice, because power cables are there and only needed to be connected to the battery.
Logic will get you from A to B. Imagination will take you everywhere.
manjh
Posts: 729
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Looking for a Zigbee tag

Post by manjh »

Kedi wrote: Friday 06 December 2024 15:13 Problem with 2G and 4G is that people don't read the description well and order the wrong one and complain afterwards.
When you search for "ST-901 4G" both 2G and 4G will be presented, just pick the right one.
As I understand from the reviews at AliExpress, people have specifically ordered a 4G tracker as advertised, but received a 2G version... normally you would return it to the vendor, but with AliExpress it is not that easy. You can complain immediately after receiving the item and contend, but if you wait with the installation for a few weeks until you have some time, and then find out, it may be more of a hassle... :cry:
Hans
Kedi
Posts: 561
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Looking for a Zigbee tag

Post by Kedi »

Beter order at Ali at SinoTrack Official Store.
It's about € 20 cheaper then at Alwaysconnected
Logic will get you from A to B. Imagination will take you everywhere.
Dave21w
Posts: 369
Joined: Sunday 29 November 2015 21:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Stable
Location: UK
Contact:

Re: Looking for a Zigbee tag

Post by Dave21w »

Would it not be easier to use an ESP32 running "OpenMQTTGateway" which will then detect cheap BLE temp sensors and use a script to say if the last update time was more than X minutes ago set a switch as off (away). You also have the added advantage of knowing how cold it is in your car so in the winter you know if you'll be scraping the ice of the screen as well :lol:
manjh
Posts: 729
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Looking for a Zigbee tag

Post by manjh »

Dave21w wrote: Thursday 12 December 2024 13:27 Would it not be easier to use an ESP32 running "OpenMQTTGateway" which will then detect cheap BLE temp sensors and use a script to say if the last update time was more than X minutes ago set a switch as off (away). You also have the added advantage of knowing how cold it is in your car so in the winter you know if you'll be scraping the ice of the screen as well :lol:
Yes, that was my original idea. I already use an ESP unit to keep track of my floor heating (it switches on automatically). The ESP sends a "heartbeat" signal, and in Domoticz I keep track of that. But I intended to run it off a battery or powerbank, and that turns out to be insufficient. I tried the biggest powerbank I have, on a full charge it runs about 1 day. Alternative is to hook it up to the car battery, but I will have to look at the power consumption of the unit. There are times when the car is not used for 2 or 3 weeks... and I would not want to drain the battery.
Hans
manjh
Posts: 729
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Looking for a Zigbee tag

Post by manjh »

Kedi wrote: Thursday 12 December 2024 9:49 Beter order at Ali at SinoTrack Official Store.
It's about € 20 cheaper then at Alwaysconnected
How do I find the official store at AliExpress? Can you send a link?
Hans
Kedi
Posts: 561
Joined: Monday 20 March 2023 14:41
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Somewhere in NL
Contact:

Re: Looking for a Zigbee tag

Post by Kedi »

Logic will get you from A to B. Imagination will take you everywhere.
manjh
Posts: 729
Joined: Saturday 27 February 2016 12:49
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Looking for a Zigbee tag

Post by manjh »

Kedi wrote: Thursday 12 December 2024 19:07 https://sinotrack.nl.aliexpress.com/sto ... XsnKXsnKxI
Thanks, that helps.
When I follow that link and search for 901L, I can still see four different offerings from the Sinotrack store, more or less the same... confusing.
Hans
Shred
Posts: 5
Joined: Monday 23 October 2017 0:33
Target OS: Linux
Domoticz version:
Contact:

Re: Looking for a Zigbee tag

Post by Shred »

I've been using some cheap Nut Find3 ( https://www.nutfind.com/collections/all ... herry-gray ) Bluetooth beacons - one in each car and one in my bike, plus using our mobile phones with the Espresense (https://espresense.com/) firmware for the ESP32. The beacons run for a year to 18 months on a CR2032 battery.

Espresense is more geared to Home Assistant, but if you have Zigbee2MQTT, it should talk to Domoticz. I have multiple Espresense devices in the house and a voting system: if both the car and the mobile phone are absent, then that person is away. If either device can be heard, then they are at home. The range is pretty good too. My front gate is 20m from the house. Frequently, the system knows that I'm home when I pull up to open the gate.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests