Help with 3-way wiring

I have 3 light switches in my upstairs hallway. I want to change them to all zwave. However can’t figure out what to plug where. I have a 3-way dimmer switch and one aux switch to replace the 3 existing.

Attached is a picture of the master switch current non zwave wiring and the second switch in the hall wiring. 3rd switch is not pictures but imagine it’s same as secondary.

That first pic (with white wires bundled in back… or maybe it’s just texture-coat overspray on one or more of the colored wires?) looks like it might be a four-way switch wiring. Normal convention is:

  • Green = ground
  • White = neutral
  • Black = hot (unlike in DC wiring, where black is ground return; with AC, you’ll have two of these)
  • Red = traveller (required for 3-way and 4-way)

You can run a 3-way switch without neutral, but not a Z-wave 3-way. Neutral is required to keep the Z-wave radio powered so it can receive commands.