TedZanzibar

joined 2 years ago
[–] TedZanzibar@feddit.uk 1 points 5 days ago

That first line is what CGPT helped me with. I wanted something that I don't need to modify when I add or remove lights, so this just gets everything. Ideally I'd just get the lights that don't have the power restore feature but most of my lights go via Hue and that doesn't expose the feature to HA at all.

The input_boolean is a thing I already had setup. The UPS fires a webhook event when it goes in and out of battery mode and there's a separate automation that switches the helper based on those.

[–] TedZanzibar@feddit.uk 1 points 5 days ago (2 children)

Got a little help from CGPT so it might not be perfect, but this seems to work from my limited testing:

triggers:
  - trigger: state
    entity_id:
      - input_boolean.ups_power
conditions: []
actions:
  - choose:
      - conditions:
          - condition: state
            entity_id: input_boolean.ups_power
            state:
              - "on"
        sequence:
          - action: scene.create
            data:
              scene_id: light_states_backup
              snapshot_entities: |
                {{ states.light | map(attribute='entity_id') | list }}
      - conditions:
          - condition: state
            entity_id: input_boolean.ups_power
            state:
              - "off"
        sequence:
          - action: scene.turn_on
            target:
              entity_id: scene.light_states_backup
            data: {}
          - delay:
              hours: 0
              minutes: 0
              seconds: 10
              milliseconds: 0
          - action: scene.delete
            data:
              entity_id: scene.light_states_backup
mode: single

I've only tested it by toggling the UPS boolean manually and not actually cutting the power, so I'm probably going to need to add a delay, or a retry loop or something to make sure the scene applies consistently but so far so good! Thanks for the inspiration.

[–] TedZanzibar@feddit.uk 1 points 5 days ago

Thank you. I've also never used scenes beyond what comes built-in with Hue! This is all good stuff.

[–] TedZanzibar@feddit.uk 1 points 1 week ago (5 children)

Thank you, that's food for thought at least.

Can I ask about your light script? I have a bunch of smart bulbs that either don't support or don't expose the 'power-on behaviour' option, so in a power cut they come on full bright when power is restored, often in the middle of the night.

My HA is on a UPS so I've been trying to have it store the states of lights when the UPS switches to battery power (before they go to unavailable) and then restore those states when power comes back, but it's apparently way beyond my skill set. Curious as to how your "input list of lights" works and whether it could help me...

[–] TedZanzibar@feddit.uk 2 points 1 week ago (7 children)

Curious as to what you're using scripts for? I have 88 automations and have so far found no need for a single script and I feel like I'm missing a trick somewhere.

Yes, I do have some automations that share functionality but it's one or two actions and it seems redundant to call a separate script.

[–] TedZanzibar@feddit.uk 10 points 1 week ago (1 children)

Laziest eh? Probably the one that deletes completed items from my shopping list when I leave the supermarket, because I got sick of doing it manually.

Most ridiculous would be the NFC tag I have on the lid of my cold brew coffee jug. I make a batch so rarely that I can never remember how much coffee to add, so scanning the tag makes my Google Home say; "You want 80g of coffee per litre, or 6 scoops."

[–] TedZanzibar@feddit.uk 16 points 1 month ago (2 children)

Exactly this. We used to run Mattermost (essentially Slack but hosted on-prem) and Zoom, and everybody loved the combination. Then the bean counters got involved, saw that we were paying extra for something that was already included with our 365 subscription, and that was that.

Now we're stuck with shitty Teams and its shitty Electron app that seems to come up with new ways to not work on a near daily basis. So much so that "Teams be Teamsing" has become a defacto phrase for when something janky happens.

[–] TedZanzibar@feddit.uk 12 points 1 month ago (3 children)

Dammit, I was looking forward to SoT seeing as it plays pretty janky now compared to modern standards and I was hoping they'd fix up the combat a bit. That said, I only have the Xbox version to go off of. Is the PC version any good? Maybe someone will do a Black Mesa on it.

[–] TedZanzibar@feddit.uk 5 points 1 month ago

Especially if it has mint frosting.

[–] TedZanzibar@feddit.uk 9 points 1 month ago

Tell that to Michel Lotito who, allegedly, ate an entire Cessna 150.

[–] TedZanzibar@feddit.uk 5 points 1 month ago (1 children)

Yeah I was wondering the same thing. Didn't Abort just cancel trying to read that sector, while Fail would cancel the entire operation?

Nope, I looked it up. Abort would completely abort the whole thing, while Fail was supposed to return an error code to the program so that it could decide what to do next. Like Ignore but less crashy.

[–] TedZanzibar@feddit.uk 9 points 1 month ago (3 children)

(A)bort, (R)etry, (F)ail?

 

Quick overview of my setup: Synology NAS running a whole bunch of Docker containers and a couple of full blown VMs, and an N100 based mini PC running Ubuntu Server for those containers that benefit from hardware acceleration.

On the NAS I have a Linux Mint VM that I use for various desktoppy things, but performance via RDP or NoMachine and so on is just bad. I think it's ultimately due to the lack of acceleration, so I'd like to try running it from the mini PC instead but I'm struggling to find hypervisor options.

VirtualBox can be done headless, apparently, but the package installed via Apt wants to install X/Wayland and the entire desktop experience. LXC looks like it might be a viable option with its web frontend but it appears to be conflicting with Docker atm and won't run the setup.

Another option is to redo the machine with UnRaid or TrueNAS Scale but as they're designed to be full fledged NAS OSes I don't love that idea.

So what would you do? Does anyone have a similar setup with advice?

Thanks all!

Edit: Thanks for everyone's comments. I still can't get LXC to work, which is a shame because it has a nice web frontend, so I'll give KVM a go as my next option. Failing that I might well backup my Docker volumes, blat the whole thing and see what Proxmox can do.

Edit 2: Webtop looks to be exactly what I was looking for. Thanks again for everyone's help and suggestions.

 

Specifically from the standpoint of protecting against common and not-so-common exploits.

I understand the concept of a reverse proxy and how works on the surface level, but do any of the common recommendations (npm, caddy, traefik) actually do anything worthwhile to protect against exploit probes and/or active attacks?

Npm has a "block common exploits" option but I can't find anything about what that actually does, caddy has a module to add crowdsec support which looks like it could be promising but I haven't wrapped my head around it yet, and traefik looks like a massive pain to get going in the first place!

Meanwhile Bunkerweb actually looks like it's been built with robust protections out of the box, but seems like it's just as complicated as traefik to setup, and DNS based Let's Encrypt requires a pro subscription so that's a no-go for me anyway.

Would love to hear people's thoughts on the matter and what you're doing to adequately secure your setup.

Edit: Thanks for all of your informative replies, everyone. I read them all and replied to as many as I could! In the end I've managed to get npm working with crowdsec, and once I get cloudflare to include the source IP with the requests I think I'll be happy enough with that solution.

 

I work in tech and am constantly finding solutions to problems, often on other people's tech blogs, that I think "I should write that down somewhere" and, well, I want to actually start doing that, but I don't want to pay someone else to host it.

I have a Synology NAS, a sweet domain name, and familiarity with both Docker and Cloudflare tunnels. Would I be opening myself up to a world of hurt if I hosted a publicly available website on my NAS using [insert simple blogging platform], in a Docker container and behind some sort of Cloudflare protection?

In theory that's enough levels of protection and isolation but I don't know enough about it to not be paranoid about everything getting popped and providing access to the wider NAS as a whole.

Update: Thanks for the replies, everyone, they've been really helpful and somewhat reassuring. I think I'm going to have a look at Github and Cloudflare's pages as my first port of call for my needs.

 

Hey there, my local instance has had two admin posts pinned for the last 6 months-ish and they show right at the top of my Subscribed, Local, and All views. I can't imagine they're going to get un-pinned any time soon, so it would be great to get a feature where we can hide them.

Thanks for the consideration!

view more: next ›