Self-powered 433Mhz transmitter with encryption

I would like to add a couple of switches around my smart home so that I don't have to trigger certain things from my phone all the time. At the moment I only have AC-powered light switches, but I'd like to add more switches (e.g. to turn on music or to trigger a specific scene in home assistant or to open my window shades).

I really don't want to add AC-powered switches to my house because I don't have enough time or patience for this and I also don't want to add battery-powered switches because in a few years after adding 50 switches I'll probably find myself having to change the battery of at least one of them every week. I want a zero-maintenance solution.

I know there are 433Mhz switches that are literally powered by your finger pushing the button, no battery, no AC. I assume they some sort of piezo element to generate the power required.

This is definitely very tempting to me. There is just one more issue and that is: lack of encryption.
I would not be comfortable controlling my window openers or door locks via unencrypted 433Mhz signals.

So I was thinking if it would even be possible to have encryption and I think it would work if the transmitter had a low-power hardware accelerated encryption chip, a key that I could hardcode into my receiver and maybe an encrypted message that changes every time and is only valid once.
For instance, the first time the message would be "Open_window_0001" , the second time it would have to be "Open_window_0002" and these messages get encrypted so that they become unusable gibberish to an attacker and each message would only be valid once to make replay-attacks impossible.

Does something like that exist? I mean a self-powered encrypted 433Mhz transmitter?

Did you ask the WWW already too?

Yes, how about you?

Encryption is worthless if the data does not change. If it does not change, the encrypted message never changes.

That's why I suggested adding an incrementing number to every message, so that no two messages will be the same. This way you can tell the receiver to only allow each message once and thus prevent any replay attacks.

And if the transmitter and the receiver EVER go out of sync, what then?

Why would they? I don't see what could get them "out of sync". The only thing that could happen is that the transmitter sends a message that gets lost due to interference. In that case you would simply tell the transmitter to transmit again and once the receiver receives for example message 107, it will invalidate all messages with a counter lower or equal 107. So next time you'd send a message with the number 108 and it will be fine, while the lost message with the number 106 simply gets invalidated to prevent a replay attack.

If AC power is off and you attempt to turn on a light switch, you are now out of sync. I think you need to prototype your system.

There is no "out of sync". It doesn't matter if you send message 108 and 109 and 110 while the receiver is down. Those message would simply get lost. And next time you press the button, while the receiver is up, it will receive message 111, accept it and from then only accept messages with a count higher than 111, meaning those lost messages have been invalidated.

Why not just use garage door openers all the way around and avoid the development time?

Because they rely on batteries. That's the whole point as explained in the first post.

Then solve that problem and you are almost there!

Thanks, it never occurred to me to just solve the problem. (sarcasm)

That is called a "rolling code" and is how garage door openers work. You can buy chips that do that, or use the Keeloq encryption library to implement it in software.

Since encryption takes some computing power, I would be interested to know if you could get encryption+data transmission to work with a one-click piezo-powered device.

Yes, that is exactly my worry. It's probably possible with dedicated silicon, but the question is, if the chip exists. :grimacing:

if the chip exists

Microchip sells them.

But are they low-power enough that a "piezo-pulse" could power it?

You can read the data sheet and find out.

Sure, do happen to have a link? But I don't even know how much power a piezo would produce. So it would be hard for me to calculate that.
Edit: I see you already linked it in your post.

Edit2: But realistically it is kinda unlikely that these chips are low power enough. Otherwise battery-less remotes would be more common, right? I mean I can't remember a single garage door or car remote that didn't rely on a battery.

You are the one who needs to determine whether your idea is even workable. It won't be settled in this thread.

You could always add a little hand-crank generator!

Good luck with your project.