Project Help - standing desk daily timer/tracker

Hey,
not sure if this is the correct location, sorry if not.

i have a fully standing desk, which is great - i want to track how often im standing at it each day.
I have a Samsung multipurpose sensor that can measure XYZ.

SO i was thinking i put this on the desk, then whenever the desk is raised to “x” height (standing) it would start a timer, that would then stop again when lowered.
each day i could then track how many minutes ive been standing.

Ideally you could set a goal of “x” hours and you can trend if you are close and remind each hour if not hitting the goal or something?!

Anyway, couldn’t see this being done by someone already and i have NO idea where to even start!

could someone advise a good place? i assume i need to:

  1. have somewhere to store the time data in a db?
  2. work out how to start a timer, when the XYZ values changes

thoughts?

Hey, Jamie…I was wondering if you could explain how you got the sensor to expose all of the values here. Mine are showing temp, battery %, an on/off state (that doesn’t seem to change), and an open/close state (that also doesn’t seem to change). I’m not, however able to see the x/y/z coordinates or the acceleration.

hey man, which device do you have sorry? i have the new samsung smarthings multipurpose sensor

I have the same exact device. I think they call it the “2018” version of the Samsung Multipurpose Sensor.

You could use a template binary sensor which is set to on when the z coordinate is above a certain threshold and record the time that sensor was on for the day using the History Statistics Sensor.

Something like this:

binary_sensor:
  - platform: template
    sensors:
      desk_standing:
        friendly_name: "Desk Standing"
        value_template: "{{ states('sensor.work_desk_mps_z_coordinate')|float > THRESHOLD }}"

sensor:
  - platform: history_stats
    name: Desk Standing Today
    entity_id: binary_sensor.desk_standing
    state: 'on'
    type: time
    start: '{{ now().replace(hour=0).replace(minute=0).replace(second=0) }}'
    end: '{{ now() }}'
1 Like

The question I was asking, is now you were able to get the x/y/z coordinate values to even show up in home assistant. Your “sensor.work_desk_mps_z_coordinate” had to have come from somewhere, right? If I pair one of these devices, those attributes don’t show up as available sensors. I can view the clusters in the customization menu, but that particular end point doesn’t show up in HA.

hey, its just showing up in my state list.
i connected samsung smartthing with the OTB integrations feature.
if you have done that, im not sure why it doesnt just show up for you too?

thanks, just what i needed, will give it a go

Ah…there’s the difference. I had added the devices to my HA via a Nortek HUSBZB-1 zwave/zigbee controller.

I’m trying to get it done without linking my ST hub to HA, as that setup kinda polluted things a bit for me…and I’m trying like hell to avoid anything having to go up through Samsung’s ridiculously slow cloud server.

1 Like

Hi @Jamie_Pryer, were you able to get this working well? I’d like to do the same.

Sorry, not spent any time on this, might pick it up again over Xmas i think

also, check this out as another way of doing this;

Heh, that’s clever. Thanks for sharing!

1 Like